summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2020-04-03 20:56:43 +0000
committerEd Maste <emaste@FreeBSD.org>2020-04-03 20:56:43 +0000
commit6e46e45f9726c8d2257dca29edc75be5253def9c (patch)
tree519bf85725660ee5fd3daa90a646b192ad672e5e
parentccb1ebe01caa1fa2d79b3b66f4bb1391e837a866 (diff)
Notes
-rw-r--r--lib/libmd/md4c.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/lib/libmd/md4c.c b/lib/libmd/md4c.c
index 4cb1368140193..66d3652465a94 100644
--- a/lib/libmd/md4c.c
+++ b/lib/libmd/md4c.c
@@ -93,8 +93,8 @@ static unsigned char PADDING[64] = {
/* MD4 initialization. Begins an MD4 operation, writing a new context.
*/
-void MD4Init (context)
-MD4_CTX *context; /* context */
+void
+MD4Init(MD4_CTX *context)
{
context->count[0] = context->count[1] = 0;
@@ -110,10 +110,8 @@ MD4_CTX *context; /* context */
operation, processing another message block, and updating the
context.
*/
-void MD4Update (context, in, inputLen)
-MD4_CTX *context; /* context */
-const void *in; /* input block */
-unsigned int inputLen; /* length of input block */
+void
+MD4Update(MD4_CTX *context, const void *in, unsigned int inputLen)
{
unsigned int i, idx, partLen;
const unsigned char *input = in;
@@ -149,8 +147,8 @@ unsigned int inputLen; /* length of input block */
}
/* MD4 padding. */
-void MD4Pad (context)
-MD4_CTX *context; /* context */
+void
+MD4Pad(MD4_CTX *context)
{
unsigned char bits[8];
unsigned int idx, padLen;
@@ -171,9 +169,8 @@ MD4_CTX *context; /* context */
/* 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 */
+void
+MD4Final(unsigned char digest[16], MD4_CTX *context)
{
/* Do padding */
MD4Pad (context);
@@ -188,9 +185,8 @@ MD4_CTX *context; /* context */
/* MD4 basic transformation. Transforms state based on block.
*/
-static void MD4Transform (state, block)
-UINT4 state[4];
-const unsigned char block[64];
+static void
+MD4Transform(UINT4 state[4], const unsigned char block[64])
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
@@ -263,10 +259,8 @@ const unsigned char block[64];
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
a multiple of 4.
*/
-static void Encode (output, input, len)
-unsigned char *output;
-UINT4 *input;
-unsigned int len;
+static void
+Encode(unsigned char *output, UINT4 *input, unsigned int len)
{
unsigned int i, j;
@@ -281,11 +275,8 @@ unsigned int len;
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
a multiple of 4.
*/
-static void Decode (output, input, len)
-
-UINT4 *output;
-const unsigned char *input;
-unsigned int len;
+static void
+Decode(UINT4 *output, const unsigned char *input, unsigned int len)
{
unsigned int i, j;