diff options
-rw-r--r-- | coreutils/Config.in | 15 | ||||
-rw-r--r-- | libbb/hash_fd.c | 18 |
2 files changed, 20 insertions, 13 deletions
diff --git a/coreutils/Config.in b/coreutils/Config.in index 31e97c145..5e1195837 100644 --- a/coreutils/Config.in +++ b/coreutils/Config.in | |||
@@ -323,6 +323,21 @@ config CONFIG_MD5SUM | |||
323 | help | 323 | help |
324 | md5sum is used to print or check MD5 checksums. | 324 | md5sum is used to print or check MD5 checksums. |
325 | 325 | ||
326 | config CONFIG_MD5SUM_SIZE_VS_SPEED | ||
327 | int " Trade Bytes for Speed" | ||
328 | default 2 | ||
329 | range 0 3 | ||
330 | depends on CONFIG_MD5SUM | ||
331 | help | ||
332 | Trade binary size versus speed for the md5sum algorithm. | ||
333 | Approximate values running uClibc and hashing | ||
334 | linux-2.4.4.tar.bz2 were: | ||
335 | user times (sec) text size (386) | ||
336 | 0 (fastest) 1.1 6144 | ||
337 | 1 1.4 5392 | ||
338 | 2 3.0 5088 | ||
339 | 3 (smallest) 5.1 4912 | ||
340 | |||
326 | config CONFIG_MKDIR | 341 | config CONFIG_MKDIR |
327 | bool "mkdir" | 342 | bool "mkdir" |
328 | default n | 343 | default n |
diff --git a/libbb/hash_fd.c b/libbb/hash_fd.c index 5f12259b3..3445a25a0 100644 --- a/libbb/hash_fd.c +++ b/libbb/hash_fd.c | |||
@@ -5,19 +5,7 @@ | |||
5 | * Copyright (C) 2003 Glenn L. McGrath | 5 | * Copyright (C) 2003 Glenn L. McGrath |
6 | * Copyright (C) 2003 Erik Andersen | 6 | * Copyright (C) 2003 Erik Andersen |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
21 | */ | 9 | */ |
22 | 10 | ||
23 | #include <byteswap.h> | 11 | #include <byteswap.h> |
@@ -271,7 +259,11 @@ static void sha1_end(unsigned char hval[], struct sha1_ctx_t *ctx) | |||
271 | * 3 (smallest) 5.1 4912 | 259 | * 3 (smallest) 5.1 4912 |
272 | */ | 260 | */ |
273 | 261 | ||
262 | # if CONFIG_MD5SUM_SIZE_VS_SPEED < 0 || CONFIG_MD5SUM_SIZE_VS_SPEED > 3 | ||
274 | # define MD5SUM_SIZE_VS_SPEED 2 | 263 | # define MD5SUM_SIZE_VS_SPEED 2 |
264 | # else | ||
265 | # define MD5SUM_SIZE_VS_SPEED CONFIG_MD5SUM_SIZE_VS_SPEED | ||
266 | # endif | ||
275 | 267 | ||
276 | /* Handle endian-ness */ | 268 | /* Handle endian-ness */ |
277 | # if __BYTE_ORDER == __LITTLE_ENDIAN | 269 | # if __BYTE_ORDER == __LITTLE_ENDIAN |