Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272273
b: refs/heads/master
c: 7c39017
h: refs/heads/master
i:
  272271: 16e6da5
v: v3
  • Loading branch information
Mathias Krause authored and Herbert Xu committed Aug 10, 2011
1 parent aaeffec commit dba47e3
Show file tree
Hide file tree
Showing 3 changed files with 9 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: b64dc04beba30947dc80745dcb95ae3c04fd18cf
refs/heads/master: 7c390170b49337477985be7a624015160ffeb056
9 changes: 5 additions & 4 deletions trunk/crypto/sha1_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static int sha1_init(struct shash_desc *desc)
return 0;
}

static int sha1_update(struct shash_desc *desc, const u8 *data,
int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
struct sha1_state *sctx = shash_desc_ctx(desc);
Expand Down Expand Up @@ -71,6 +71,7 @@ static int sha1_update(struct shash_desc *desc, const u8 *data,

return 0;
}
EXPORT_SYMBOL(crypto_sha1_update);


/* Add padding and return the message digest. */
Expand All @@ -87,10 +88,10 @@ static int sha1_final(struct shash_desc *desc, u8 *out)
/* Pad out to 56 mod 64 */
index = sctx->count & 0x3f;
padlen = (index < 56) ? (56 - index) : ((64+56) - index);
sha1_update(desc, padding, padlen);
crypto_sha1_update(desc, padding, padlen);

/* Append length */
sha1_update(desc, (const u8 *)&bits, sizeof(bits));
crypto_sha1_update(desc, (const u8 *)&bits, sizeof(bits));

/* Store state in digest */
for (i = 0; i < 5; i++)
Expand Down Expand Up @@ -121,7 +122,7 @@ static int sha1_import(struct shash_desc *desc, const void *in)
static struct shash_alg alg = {
.digestsize = SHA1_DIGEST_SIZE,
.init = sha1_init,
.update = sha1_update,
.update = crypto_sha1_update,
.final = sha1_final,
.export = sha1_export,
.import = sha1_import,
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/crypto/sha.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ struct sha512_state {
u8 buf[SHA512_BLOCK_SIZE];
};

extern int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
unsigned int len);

#endif

0 comments on commit dba47e3

Please sign in to comment.