aboutsummaryrefslogtreecommitdiff
path: root/crypto/md5.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2014-08-13 16:14:13 -0500
committerDavid Barksdale <amatus@amatus.name>2014-08-13 16:14:13 -0500
commitace6c6d243016e272050787c14e27a83ecd94a25 (patch)
treec837edb1ca98b2552fbc7edba47aeb63f98ca1f0 /crypto/md5.c
parent1b6e1688bd215cd7c9cb75650fa815a1ec6567e1 (diff)
Diffstat (limited to 'crypto/md5.c')
-rw-r--r--crypto/md5.c17
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",