aboutsummaryrefslogtreecommitdiff
path: root/libbb/sha1.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-10-17 03:21:51 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-10-17 03:21:51 +0200
commitf6dacc23ff495cbdd3f1baf5985ded21a7e4a9c9 (patch)
treeb4c56ec45f126d37244e2b125c7c3faeb0a20298 /libbb/sha1.c
parent36ab585f68295487a0973bde86bcb0ab7577a8ff (diff)
downloadbusybox-w32-f6dacc23ff495cbdd3f1baf5985ded21a7e4a9c9.tar.gz
busybox-w32-f6dacc23ff495cbdd3f1baf5985ded21a7e4a9c9.tar.bz2
busybox-w32-f6dacc23ff495cbdd3f1baf5985ded21a7e4a9c9.zip
bring md5 and sha1 names closer. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/sha1.c')
-rw-r--r--libbb/sha1.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libbb/sha1.c b/libbb/sha1.c
index 3e61aff6d..d79291148 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -469,10 +469,10 @@ void FAST_FUNC sha1_end(sha1_ctx_t *ctx, void *resbuf)
469 469
470 /* This loop iterates either once or twice, no more, no less */ 470 /* This loop iterates either once or twice, no more, no less */
471 while (1) { 471 while (1) {
472 unsigned pad = 64 - bufpos; 472 unsigned remaining = 64 - bufpos;
473 memset(ctx->wbuffer + bufpos, 0, pad); 473 memset(ctx->wbuffer + bufpos, 0, remaining);
474 /* Do we have enough space for the length count? */ 474 /* Do we have enough space for the length count? */
475 if (pad >= 8) { 475 if (remaining >= 8) {
476 /* Store the 64-bit counter of bits in the buffer in BE format */ 476 /* Store the 64-bit counter of bits in the buffer in BE format */
477 uint64_t t = ctx->total64 << 3; 477 uint64_t t = ctx->total64 << 3;
478 t = hton64(t); 478 t = hton64(t);
@@ -480,7 +480,7 @@ void FAST_FUNC sha1_end(sha1_ctx_t *ctx, void *resbuf)
480 *(uint64_t *) (&ctx->wbuffer[64 - 8]) = t; 480 *(uint64_t *) (&ctx->wbuffer[64 - 8]) = t;
481 } 481 }
482 ctx->process_block(ctx); 482 ctx->process_block(ctx);
483 if (pad >= 8) 483 if (remaining >= 8)
484 break; 484 break;
485 bufpos = 0; 485 bufpos = 0;
486 } 486 }
@@ -503,9 +503,9 @@ void FAST_FUNC sha512_end(sha512_ctx_t *ctx, void *resbuf)
503 ctx->wbuffer[bufpos++] = 0x80; 503 ctx->wbuffer[bufpos++] = 0x80;
504 504
505 while (1) { 505 while (1) {
506 unsigned pad = 128 - bufpos; 506 unsigned remaining = 128 - bufpos;
507 memset(ctx->wbuffer + bufpos, 0, pad); 507 memset(ctx->wbuffer + bufpos, 0, remaining);
508 if (pad >= 16) { 508 if (remaining >= 16) {
509 /* Store the 128-bit counter of bits in the buffer in BE format */ 509 /* Store the 128-bit counter of bits in the buffer in BE format */
510 uint64_t t; 510 uint64_t t;
511 t = ctx->total64[0] << 3; 511 t = ctx->total64[0] << 3;
@@ -516,7 +516,7 @@ void FAST_FUNC sha512_end(sha512_ctx_t *ctx, void *resbuf)
516 *(uint64_t *) (&ctx->wbuffer[128 - 16]) = t; 516 *(uint64_t *) (&ctx->wbuffer[128 - 16]) = t;
517 } 517 }
518 sha512_process_block128(ctx); 518 sha512_process_block128(ctx);
519 if (pad >= 16) 519 if (remaining >= 16)
520 break; 520 break;
521 bufpos = 0; 521 bufpos = 0;
522 } 522 }