summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md4/md4.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/md4/md4.c (renamed from src/lib/libcrypto/md4/md4_dgst.c)19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/libcrypto/md4/md4_dgst.c b/src/lib/libcrypto/md4/md4.c
index 33a1cd777e..a60196e5b9 100644
--- a/src/lib/libcrypto/md4/md4_dgst.c
+++ b/src/lib/libcrypto/md4/md4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: md4_dgst.c,v 1.21 2023/07/15 15:30:43 jsing Exp $ */ 1/* $OpenBSD: md4.c,v 1.5 2023/07/28 11:04:41 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -247,3 +247,20 @@ md4_block_data_order(MD4_CTX *c, const void *data_, size_t num)
247 } 247 }
248} 248}
249#endif 249#endif
250
251unsigned char *
252MD4(const unsigned char *d, size_t n, unsigned char *md)
253{
254 MD4_CTX c;
255 static unsigned char m[MD4_DIGEST_LENGTH];
256
257 if (md == NULL)
258 md = m;
259 if (!MD4_Init(&c))
260 return NULL;
261 MD4_Update(&c, d, n);
262 MD4_Final(md, &c);
263 explicit_bzero(&c, sizeof(c));
264 return (md);
265}
266LCRYPTO_ALIAS(MD4);