summaryrefslogtreecommitdiffstats
path: root/md5/hmac.c
diff options
context:
space:
mode:
authorSam Varshavchik2013-08-19 16:39:41 -0400
committerSam Varshavchik2013-08-25 14:43:51 -0400
commit9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch)
tree7a81a04cb51efb078ee350859a64be2ebc6b8813 /md5/hmac.c
parenta9520698b770168d1f33d6301463bb70a19655ec (diff)
downloadcourier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2
Initial checkin
Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'md5/hmac.c')
-rw-r--r--md5/hmac.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/md5/hmac.c b/md5/hmac.c
new file mode 100644
index 0000000..26589ab
--- /dev/null
+++ b/md5/hmac.c
@@ -0,0 +1,35 @@
+/*
+** Copyright 1998 - 1999 Double Precision, Inc.
+** See COPYING for distribution information.
+*/
+
+#define MD5_INTERNAL
+#include "md5.h"
+#include "../libhmac/hmac.h"
+
+static void alloc_context( void (*func)(void *, void *), void *arg)
+{
+struct MD5_CONTEXT c;
+
+ (*func)((void *)&c, arg);
+}
+
+static void alloc_hash( void (*func)(unsigned char *, void *), void *arg)
+{
+unsigned char c[MD5_DIGEST_SIZE];
+
+ (*func)(c, arg);
+}
+
+struct hmac_hashinfo hmac_md5 = {
+ "md5",
+ MD5_BLOCK_SIZE,
+ MD5_DIGEST_SIZE,
+ sizeof(struct MD5_CONTEXT),
+ (void (*)(void *))md5_context_init,
+ (void (*)(void *, const void *, unsigned))md5_context_hashstream,
+ (void (*)(void *, unsigned long))md5_context_endstream,
+ (void (*)(void *, unsigned char *))md5_context_digest,
+ (void (*)(void *, const unsigned char *))md5_context_restore,
+ alloc_context,
+ alloc_hash};