-/*
+/*
Copyright (c) 1995-1998 by Cisco systems, Inc.
Permission to use, copy, modify, and distribute this software for
*/
+#include "tac_plus.h"
+
+#ifdef MSCHAP
+
#include <string.h>
+
#include "md4.h"
/*
#include "master.h"
#include <ciscolib.h>
*/
+
typedef unsigned char *POINTER;
typedef unsigned short int UINT2;
typedef unsigned long int UINT4;
-#define PROTO_LIST(list) ()
-#define const
+static void MD4Transform TAC_ARGS((UINT4 state[4], const unsigned char block[64]));
+static void Encode TAC_ARGS((unsigned char *output, UINT4 *input, unsigned int len));
+static void Decode TAC_ARGS((UINT4 *output, const unsigned char *input, unsigned int len));
+
/* Constants for MD4Transform routine.
*/
#define S33 11
#define S34 15
-static void MD4Transform PROTO_LIST ((UINT4 [4], const unsigned char [64]));
-static void Encode PROTO_LIST
- ((unsigned char *, UINT4 *, unsigned int));
-static void Decode PROTO_LIST
- ((UINT4 *, const unsigned char *, unsigned int));
-
static unsigned char PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* MD4 initialization. Begins an MD4 operation, writing a new context.
*/
+
+void MD4Init TAC_ARGS((MD4_CTX *context));
+
void MD4Init (context)
MD4_CTX *context; /* context */
{
operation, processing another message block, and updating the
context.
*/
+
+void MD4Update TAC_ARGS((MD4_CTX *context, const unsigned char *input, unsigned int inputLen));
+
void MD4Update (context, input, inputLen)
MD4_CTX *context; /* context */
const unsigned char *input; /* input block */
/* MD4 finalization. Ends an MD4 message-digest operation, writing the
the message digest and zeroizing the context.
*/
+
+void MD4Final TAC_ARGS((unsigned char digest[16], MD4_CTX *context));
+
void MD4Final (digest, context)
unsigned char digest[16]; /* message digest */
MD4_CTX *context; /* context */
/* MD4 basic transformation. Transforms state based on block.
*/
+
+static void MD4Transform TAC_ARGS((UINT4 state[4], const unsigned char block[64]));
+
static void MD4Transform (state, block)
UINT4 state[4];
const unsigned char block[64];
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
a multiple of 4.
*/
+
+static void Encode TAC_ARGS((unsigned char *output, UINT4 *input, unsigned int len));
+
static void Encode (output, input, len)
unsigned char *output;
UINT4 *input;
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
a multiple of 4.
*/
-static void Decode (output, input, len)
+static void Decode TAC_ARGS((UINT4 *output, const unsigned char *input, unsigned int len));
+
+static void Decode (output, input, len)
UINT4 *output;
const unsigned char *input;
unsigned int len;
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
+
+#else /* MSCHAP */
+
+TAC_SOURCEFILE_EMPTY
+
+#endif /* MSCHAP */