From: millert Date: Tue, 28 Mar 2000 17:35:07 +0000 (+0000) Subject: Expose MDXTransform functions to be consistent with sha1 and rmd160. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6bcf620f059b8cb93a40a672a2e3895b592e4cc9;p=openbsd Expose MDXTransform functions to be consistent with sha1 and rmd160. --- diff --git a/include/md4.h b/include/md4.h index b8874172fc9..ca3ff1664c1 100644 --- a/include/md4.h +++ b/include/md4.h @@ -1,5 +1,5 @@ /* MD4.H - header file for MD4C.C - * $OpenBSD: md4.h,v 1.4 1996/11/24 02:25:57 niklas Exp $ + * $OpenBSD: md4.h,v 1.5 2000/03/28 17:35:07 millert Exp $ */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All @@ -36,6 +36,7 @@ typedef struct MD4Context { void MD4Init __P((MD4_CTX *)); void MD4Update __P((MD4_CTX *, const unsigned char *, size_t)); void MD4Final __P((unsigned char [16], MD4_CTX *)); +void MD4Transform __P ((u_int32_t [4], const unsigned char [64])); char * MD4End __P((MD4_CTX *, char *)); char * MD4File __P((char *, char *)); char * MD4Data __P((const unsigned char *, size_t, char *)); diff --git a/include/md5.h b/include/md5.h index 638371330d3..3d67a5cb5e5 100644 --- a/include/md5.h +++ b/include/md5.h @@ -1,5 +1,5 @@ /* MD5.H - header file for MD5C.C - * $OpenBSD: md5.h,v 1.4 1996/11/24 02:25:57 niklas Exp $ + * $OpenBSD: md5.h,v 1.5 2000/03/28 17:35:08 millert Exp $ */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All @@ -37,6 +37,7 @@ typedef struct MD5Context { void MD5Init __P((MD5_CTX *)); void MD5Update __P((MD5_CTX *, const unsigned char *, size_t)); void MD5Final __P((unsigned char [16], MD5_CTX *)); +void MD5Transform __P ((u_int32_t [4], const unsigned char [64])); char * MD5End __P((MD5_CTX *, char *)); char * MD5File __P((char *, char *)); char * MD5Data __P((const unsigned char *, size_t, char *)); diff --git a/lib/libc/md/md4c.c b/lib/libc/md/md4c.c index 75e84d52384..63131d8ed79 100644 --- a/lib/libc/md/md4c.c +++ b/lib/libc/md/md4c.c @@ -22,7 +22,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md4c.c,v 1.11 1997/07/23 21:17:55 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: md4c.c,v 1.12 2000/03/28 17:35:09 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -47,8 +47,6 @@ typedef unsigned char *POINTER; #define S33 11 #define S34 15 -static void MD4Transform __P ((u_int32_t [4], const unsigned char [64])); - #if BYTE_ORDER == LITTLE_ENDIAN #define Encode memcpy #define Decode memcpy @@ -218,7 +216,7 @@ MD4_CTX *context; /* context */ /* MD4 basic transformation. Transforms state based on block. */ -static void MD4Transform (state, block) +void MD4Transform (state, block) u_int32_t state[4]; const unsigned char block[64]; { diff --git a/lib/libc/md/md5c.c b/lib/libc/md/md5c.c index 0407ba03afc..d4c57966b38 100644 --- a/lib/libc/md/md5c.c +++ b/lib/libc/md/md5c.c @@ -23,7 +23,7 @@ documentation and/or software. */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md5c.c,v 1.11 1997/07/23 21:17:56 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: md5c.c,v 1.12 2000/03/28 17:35:09 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -52,8 +52,6 @@ typedef unsigned char *POINTER; #define S43 15 #define S44 21 -static void MD5Transform __P ((u_int32_t [4], const unsigned char [64])); - #if BYTE_ORDER == LITTLE_ENDIAN #define Encode memcpy #define Decode memcpy @@ -228,7 +226,7 @@ MD5_CTX *context; /* context */ /* MD5 basic transformation. Transforms state based on block. */ -static void MD5Transform (state, block) +void MD5Transform (state, block) u_int32_t state[4]; const unsigned char block[64]; { diff --git a/lib/libc/md/mdX.3 b/lib/libc/md/mdX.3 index a240cbe2566..91c0465e45b 100644 --- a/lib/libc/md/mdX.3 +++ b/lib/libc/md/mdX.3 @@ -6,7 +6,7 @@ .\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp .\" ---------------------------------------------------------------------------- .\" -.\" $OpenBSD: mdX.3,v 1.14 1999/10/08 10:55:27 espie Exp $ +.\" $OpenBSD: mdX.3,v 1.15 2000/03/28 17:35:09 millert Exp $ .\" .Dd October 9, 1996 .Dt MDX 3 @@ -15,6 +15,7 @@ .Nm MDXInit , .Nm MDXUpdate , .Nm MDXFinal , +.Nm MDXTransform , .Nm MDXEnd , .Nm MDXFile , .Nm MDXData @@ -28,6 +29,8 @@ .Fn MDXUpdate "MDX_CTX *context" "const unsigned char *data" "unsigned int len" .Ft void .Fn MDXFinal "unsigned char digest[16]" "MDX_CTX *context" +.Ft void +.Fn MDXTransform "u_int32_t state[4]" "unsigned char block[64]" .Ft "char *" .Fn MDXEnd "MDX_CTX *context" "char *buf" .Ft "char *" @@ -69,6 +72,20 @@ as first argument only the final padding will be applied and the current context can still be used with .Fn MDXUpdate . .Pp +The +.Fn MDXTransform +function is used by +.Fn MDXUpdate +to hash 512-bit blocks and forms the core of the algorithm. +Most programs should use the interface provided by +.Fn MDXInit , +.Fn MDXUpdate +and +.Fn MDXFinal +instead of calling +.Fn MDXTransform +directly. +.Pp .Fn MDXEnd is a wrapper for .Fn MDXFinal