aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypto/nss/yhash.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypto/nss/yhash.h')
-rw-r--r--src/lib/crypto/nss/yhash.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/crypto/nss/yhash.h b/src/lib/crypto/nss/yhash.h
new file mode 100644
index 0000000..151818f
--- /dev/null
+++ b/src/lib/crypto/nss/yhash.h
@@ -0,0 +1,29 @@
+/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/* lib/crypto/openssl/hash/yhash.h
+ */
+
+#ifndef YHASH_H
+#define YHASH_H
+
+/* hash function interface */
+
+/* default to SHA1 for yarrow 160 */
+
+#include "shs.h"
+
+
+#define HASH_CTX SHS_INFO
+#define HASH_Init(x) shsInit(x)
+#define HASH_Update(x, buf, sz) shsUpdate(x, (const void*)buf, sz)
+
+#define HASH_Final(x, tdigest) do { \
+ int loopvar; \
+ unsigned char *out2 = (void *)(tdigest); \
+ HASH_CTX *ctx = (x); \
+ shsFinal(ctx); \
+ memcpy(out2, ctx->digestBuf, ctx->digestLen); \
+ } while(0)
+
+#define HASH_DIGEST_SIZE SHS_DIGESTSIZE
+
+#endif /* YHASH_H */