summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/md/md4c.c6
-rw-r--r--lib/libc/md/md5c.c6
-rw-r--r--lib/libc/md/mdX.319
3 files changed, 22 insertions, 9 deletions
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 <string.h>
@@ -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 <string.h>
@@ -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