diff options
author | Nicolas Pitre <nico@cam.org> | 2005-11-12 18:59:54 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-09 17:15:44 -0500 |
commit | 9d70a6c86cd86e111291bd0d506028ecb9649923 (patch) | |
tree | 1bff5efc7644156f4ea7bea8c9fe8410ea86bf8d /crypto | |
parent | cfa8d17cc836905ad174fd924701b352585d62f1 (diff) |
[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) | |||
49 | static void sha1_update(void *ctx, const u8 *data, unsigned int len) | 49 | static void sha1_update(void *ctx, const u8 *data, unsigned int len) |
50 | { | 50 | { |
51 | struct sha1_ctx *sctx = ctx; | 51 | struct sha1_ctx *sctx = ctx; |
52 | unsigned int i, j; | 52 | unsigned int partial, done; |
53 | const u8 *src; | 53 | const u8 *src; |
54 | 54 | ||
55 | j = (sctx->count >> 3) & 0x3f; | 55 | partial = (sctx->count >> 3) & 0x3f; |
56 | sctx->count += len << 3; | 56 | sctx->count += len << 3; |
57 | i = 0; | 57 | done = 0; |
58 | src = data; | 58 | src = data; |
59 | 59 | ||
60 | if ((j + len) > 63) { | 60 | if ((partial + len) > 63) { |
61 | u32 temp[SHA_WORKSPACE_WORDS]; | 61 | u32 temp[SHA_WORKSPACE_WORDS]; |
62 | 62 | ||
63 | if (j) { | 63 | if (partial) { |
64 | memcpy(&sctx->buffer[j], data, (i = 64-j)); | 64 | done = 64 - partial; |
65 | memcpy(sctx->buffer + partial, data, done); | ||
65 | src = sctx->buffer; | 66 | src = sctx->buffer; |
66 | } | 67 | } |
67 | 68 | ||
68 | do { | 69 | do { |
69 | sha_transform(sctx->state, src, temp); | 70 | sha_transform(sctx->state, src, temp); |
70 | i += 64; | 71 | done += 64; |
71 | src = &data[i]; | 72 | src = data + done; |
72 | } while (i + 63 < len); | 73 | } while (done + 63 < len); |
73 | 74 | ||
74 | memset(temp, 0, sizeof(temp)); | 75 | memset(temp, 0, sizeof(temp)); |
75 | j = 0; | 76 | partial = 0; |
76 | } | 77 | } |
77 | memcpy(&sctx->buffer[j], src, len - i); | 78 | memcpy(sctx->buffer + partial, src, len - done); |
78 | } | 79 | } |
79 | 80 | ||
80 | 81 | ||