#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "md2.h"
+#include <openssl/md2.h>
+#include <openssl/opensslv.h>
-char *MD2_version="MD2 part of SSLeay/OpenSSL 0.9.1c 23-Dec-1998";
+const char *MD2_version="MD2" OPENSSL_VERSION_PTEXT;
/* Implemented from RFC1319 The MD2 Message-Digest Algorithm
*/
#define UCHAR unsigned char
-#ifndef NOPROTO
static void md2_block(MD2_CTX *c, unsigned char *d);
-#else
-static void md2_block();
-#endif
-
/* The magic S table - I have converted it to hex since it is
* basicaly just a random byte string. */
static MD2_INT S[256]={
0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14,
};
-char *MD2_options()
+const char *MD2_options(void)
{
if (sizeof(MD2_INT) == 1)
return("md2(char)");
return("md2(int)");
}
-void MD2_Init(c)
-MD2_CTX *c;
+void MD2_Init(MD2_CTX *c)
{
c->num=0;
memset(c->state,0,MD2_BLOCK*sizeof(MD2_INT));
memset(c->data,0,MD2_BLOCK);
}
-void MD2_Update(c, data, len)
-MD2_CTX *c;
-register unsigned char *data;
-unsigned long len;
+void MD2_Update(MD2_CTX *c, register unsigned char *data, unsigned long len)
{
register UCHAR *p;
c->num=(int)len;
}
-static void md2_block(c, d)
-MD2_CTX *c;
-unsigned char *d;
+static void md2_block(MD2_CTX *c, unsigned char *d)
{
register MD2_INT t,*sp1,*sp2;
register int i,j;
memset(state,0,48*sizeof(MD2_INT));
}
-void MD2_Final(md, c)
-unsigned char *md;
-MD2_CTX *c;
+void MD2_Final(unsigned char *md, MD2_CTX *c)
{
int i,v;
register UCHAR *cp;