Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/sys/sys Add NetBSD/Solaris compatibility...



details:   https://anonhg.NetBSD.org/src/rev/376277224652
branches:  trunk
changeset: 752527:376277224652
user:      haad <haad%NetBSD.org@localhost>
date:      Sun Feb 28 17:22:01 2010 +0000

description:
Add NetBSD/Solaris compatibility SHA header.

diffstat:

 external/cddl/osnet/sys/sys/sha2.h |  20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r 06ebb1a05391 -r 376277224652 external/cddl/osnet/sys/sys/sha2.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/cddl/osnet/sys/sys/sha2.h        Sun Feb 28 17:22:01 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index