diff options
author | David Barksdale <amatus@amatus.name> | 2014-08-13 16:14:13 -0500 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2014-08-13 16:14:13 -0500 |
commit | ace6c6d243016e272050787c14e27a83ecd94a25 (patch) | |
tree | c837edb1ca98b2552fbc7edba47aeb63f98ca1f0 /crypto/md5.c | |
parent | 1b6e1688bd215cd7c9cb75650fa815a1ec6567e1 (diff) |
gpl-source-mybooklive-010002-update.zipgpl-source-mybooklive-010103-update.zipgpl-source-mybooklive-010002-update.zip
Diffstat (limited to 'crypto/md5.c')
-rw-r--r-- | crypto/md5.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/md5.c b/crypto/md5.c index 83eb5296175..7e6d67870e9 100644 --- a/crypto/md5.c +++ b/crypto/md5.c @@ -220,11 +220,28 @@ static int md5_final(struct shash_desc *desc, u8 *out) return 0; } +static int md5_partial(struct shash_desc *desc, u8 *data) +{ + struct md5_ctx *mctx = shash_desc_ctx(desc); + int i; + + for (i = 0; i < MD5_HASH_WORDS; i++) { + *data++ = mctx->hash[i] & 0xFF; + *data++ = (mctx->hash[i] >> 8) & 0xFF; + *data++ = (mctx->hash[i] >> 16) & 0xFF; + *data++ = (mctx->hash[i] >> 24) & 0xFF; + } + + return 0; +} + static struct shash_alg alg = { .digestsize = MD5_DIGEST_SIZE, .init = md5_init, .update = md5_update, .final = md5_final, + .partial = md5_partial, + .partialsize = MD5_DIGEST_SIZE, .descsize = sizeof(struct md5_ctx), .base = { .cra_name = "md5", |