diff options
author | phk <phk@FreeBSD.org> | 1998-03-27 10:23:00 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-03-27 10:23:00 +0000 |
commit | 4db0fa09db895f439a5a91029e7625e329fda730 (patch) | |
tree | 7280db4f963d90af6e88e2567a99dd70e34b3f35 /lib/libmd/md4c.c | |
parent | 1eaa978a478cdf6768e93ba276482ac8140c290d (diff) | |
download | FreeBSD-src-4db0fa09db895f439a5a91029e7625e329fda730.zip FreeBSD-src-4db0fa09db895f439a5a91029e7625e329fda730.tar.gz |
Split the padding out into a separate function.
Synchronize the kernel and libmd versions of md5c.c
PR: misc/6127
Reviewed by: phk
Submitted by: Ari Suutari <ari@suutari.iki.fi>
Diffstat (limited to 'lib/libmd/md4c.c')
-rw-r--r-- | lib/libmd/md4c.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/libmd/md4c.c b/lib/libmd/md4c.c index a0eba4d..71c3af7 100644 --- a/lib/libmd/md4c.c +++ b/lib/libmd/md4c.c @@ -1,5 +1,5 @@ /* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm - * $Id$ + * $Id: md4c.c,v 1.5 1997/02/22 15:07:19 peter Exp $ */ /* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. @@ -141,11 +141,8 @@ unsigned int inputLen; /* length of input block */ inputLen-i); } -/* MD4 finalization. Ends an MD4 message-digest operation, writing the - the message digest and zeroizing the context. - */ -void MD4Final (digest, context) -unsigned char digest[16]; /* message digest */ +/* MD4 padding. */ +void MD4Pad (context) MD4_CTX *context; /* context */ { unsigned char bits[8]; @@ -162,6 +159,18 @@ MD4_CTX *context; /* context */ /* Append length (before padding) */ MD4Update (context, bits, 8); +} + +/* MD4 finalization. Ends an MD4 message-digest operation, writing the + the message digest and zeroizing the context. + */ +void MD4Final (digest, context) +unsigned char digest[16]; /* message digest */ +MD4_CTX *context; /* context */ +{ + /* Do padding */ + MD4Pad (context); + /* Store state in digest */ Encode (digest, context->state, 16); |