Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17427
b: refs/heads/master
c: fa9b98f
h: refs/heads/master
i:
  17425: 61f23f0
  17423: d6d87ae
v: v3
  • Loading branch information
Nicolas Pitre authored and David S. Miller committed Jan 9, 2006
1 parent 2fcf35b commit 6854026
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d70a6c86cd86e111291bd0d506028ecb9649923
refs/heads/master: fa9b98fdab5b57ecb4dd3d6c2489e262af458c44
8 changes: 4 additions & 4 deletions trunk/crypto/sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ static void sha1_update(void *ctx, const u8 *data, unsigned int len)
unsigned int partial, done;
const u8 *src;

partial = (sctx->count >> 3) & 0x3f;
sctx->count += len << 3;
partial = sctx->count & 0x3f;
sctx->count += len;
done = 0;
src = data;

Expand Down Expand Up @@ -88,10 +88,10 @@ static void sha1_final(void* ctx, u8 *out)
__be64 bits;
static const u8 padding[64] = { 0x80, };

bits = cpu_to_be64(sctx->count);
bits = cpu_to_be64(sctx->count << 3);

/* Pad out to 56 mod 64 */
index = (sctx->count >> 3) & 0x3f;
index = sctx->count & 0x3f;
padlen = (index < 56) ? (56 - index) : ((64+56) - index);
sha1_update(sctx, padding, padlen);

Expand Down

0 comments on commit 6854026

Please sign in to comment.