Module Name:    src
Committed By:   haad
Date:           Sun Feb 28 17:22:01 UTC 2010

Added Files:
        src/external/cddl/osnet/sys/sys: sha2.h

Log Message:
Add NetBSD/Solaris compatibility SHA header.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/sys/sys/sha2.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/cddl/osnet/sys/sys/sha2.h
diff -u /dev/null src/external/cddl/osnet/sys/sys/sha2.h:1.1
--- /dev/null	Sun Feb 28 17:22:01 2010
+++ src/external/cddl/osnet/sys/sys/sha2.h	Sun Feb 28 17:22:01 2010
@@ -0,0 +1,20 @@
+#ifndef _SHA2_H_
+#define _SHA2_H_
+
+#include_next <sys/sha2.h>
+
+#define SHA2_CTX	SHA256_CTX
+#define SHA2Init(a, b)	SHA256_Init(b)
+#define SHA2Update 	SHA256_Update
+
+static void
+SHA2Final(void *digest, SHA2_CTX *ctx)
+{
+	uint8_t tmp[SHA256_DIGEST_LENGTH];
+
+	SHA256_Final(tmp, ctx);
+	memcpy(digest, &tmp, sizeof(tmp));
+}
+
+
+#endif

Reply via email to