diff options
author | Nicolas Pitre <nico@cam.org> | 2005-11-13 10:59:54 +1100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-09 14:15:44 -0800 |
commit | 9d70a6c86cd86e111291bd0d506028ecb9649923 (patch) | |
tree | 1bff5efc7644156f4ea7bea8c9fe8410ea86bf8d /crypto | |
parent | cfa8d17cc836905ad174fd924701b352585d62f1 (diff) | |
download | talos-op-linux-9d70a6c86cd86e111291bd0d506028ecb9649923.tar.gz talos-op-linux-9d70a6c86cd86e111291bd0d506028ecb9649923.zip |
[CRYPTO] sha1: Rename i/j to done/partial
This patch gives more descriptive names to the variables i and j.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/sha1.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/crypto/sha1.c b/crypto/sha1.c index 292dcc13ff92..7b1abca29365 100644 --- a/crypto/sha1.c +++ b/crypto/sha1.c @@ -49,32 +49,33 @@ static void sha1_init(void *ctx) static void sha1_update(void *ctx, const u8 *data, unsigned int len) { struct sha1_ctx *sctx = ctx; - unsigned int i, j; + unsigned int partial, done; const u8 *src; - j = (sctx->count >> 3) & 0x3f; + partial = (sctx->count >> 3) & 0x3f; sctx->count += len << 3; - i = 0; + done = 0; src = data; - if ((j + len) > 63) { + if ((partial + len) > 63) { u32 temp[SHA_WORKSPACE_WORDS]; - if (j) { - memcpy(&sctx->buffer[j], data, (i = 64-j)); + if (partial) { + done = 64 - partial; + memcpy(sctx->buffer + partial, data, done); src = sctx->buffer; } do { sha_transform(sctx->state, src, temp); - i += 64; - src = &data[i]; - } while (i + 63 < len); + done += 64; + src = data + done; + } while (done + 63 < len); memset(temp, 0, sizeof(temp)); - j = 0; + partial = 0; } - memcpy(&sctx->buffer[j], src, len - i); + memcpy(sctx->buffer + partial, src, len - done); } |