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-f6dacc23ff495cbdd3f1baf5985ded21a7e4a9c9.tar.gz
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)
/* This loop iterates either once or twice, no more, no less */
while (1) {
- unsigned pad = 64 - bufpos;
- memset(ctx->wbuffer + bufpos, 0, pad);
+ unsigned remaining = 64 - bufpos;
+ memset(ctx->wbuffer + bufpos, 0, remaining);
/* Do we have enough space for the length count? */
- if (pad >= 8) {
+ if (remaining >= 8) {
/* Store the 64-bit counter of bits in the buffer in BE format */
uint64_t t = ctx->total64 << 3;
t = hton64(t);
@@ -480,7 +480,7 @@ void FAST_FUNC sha1_end(sha1_ctx_t *ctx, void *resbuf)
*(uint64_t *) (&ctx->wbuffer[64 - 8]) = t;
}
ctx->process_block(ctx);
- if (pad >= 8)
+ if (remaining >= 8)
break;
bufpos = 0;
}
@@ -503,9 +503,9 @@ void FAST_FUNC sha512_end(sha512_ctx_t *ctx, void *resbuf)
ctx->wbuffer[bufpos++] = 0x80;
while (1) {
- unsigned pad = 128 - bufpos;
- memset(ctx->wbuffer + bufpos, 0, pad);
- if (pad >= 16) {
+ unsigned remaining = 128 - bufpos;
+ memset(ctx->wbuffer + bufpos, 0, remaining);
+ if (remaining >= 16) {
/* Store the 128-bit counter of bits in the buffer in BE format */
uint64_t t;
t = ctx->total64[0] << 3;
@@ -516,7 +516,7 @@ void FAST_FUNC sha512_end(sha512_ctx_t *ctx, void *resbuf)
*(uint64_t *) (&ctx->wbuffer[128 - 16]) = t;
}
sha512_process_block128(ctx);
- if (pad >= 16)
+ if (remaining >= 16)
break;
bufpos = 0;
}