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/md2c.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/md2c.c')
-rw-r--r-- | lib/libmd/md2c.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/libmd/md2c.c b/lib/libmd/md2c.c index ebf9edc..561337a 100644 --- a/lib/libmd/md2c.c +++ b/lib/libmd/md2c.c @@ -1,5 +1,5 @@ /* MD2C.C - RSA Data Security, Inc., MD2 message-digest algorithm - * $Id$ + * $Id: md2c.c,v 1.5 1997/02/22 15:07:15 peter Exp $ */ /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All @@ -131,11 +131,9 @@ unsigned int inputLen; /* length of input block */ inputLen-i); } -/* MD2 finalization. Ends an MD2 message-digest operation, writing the - message digest and zeroizing the context. +/* MD2 padding. */ -void MD2Final (digest, context) -unsigned char digest[16]; /* message digest */ +void MD2Pad (context) MD2_CTX *context; /* context */ { unsigned int index, padLen; @@ -148,6 +146,17 @@ MD2_CTX *context; /* context */ /* Extend with checksum */ MD2Update (context, context->checksum, 16); +} + +/* MD2 finalization. Ends an MD2 message-digest operation, writing the + message digest and zeroizing the context. + */ +void MD2Final (digest, context) +unsigned char digest[16]; /* message digest */ +MD2_CTX *context; /* context */ +{ + /* Do padding */ + MD2Pad (context); /* Store state in digest */ memcpy ((POINTER)digest, (POINTER)context->state, 16); |