summaryrefslogtreecommitdiff
path: root/packages/moxiebox/sha.h
diff options
context:
space:
mode:
Diffstat (limited to 'packages/moxiebox/sha.h')
-rw-r--r--packages/moxiebox/sha.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/moxiebox/sha.h b/packages/moxiebox/sha.h
new file mode 100644
index 0000000..36b90a1
--- /dev/null
+++ b/packages/moxiebox/sha.h
@@ -0,0 +1,23 @@
+/*
+ Wrapper around moxiebox'es implementation of SHA256 digest that
+ mimics the API of the OpenSSL implementation.
+*/
+
+#ifndef __SHA_H_
+#define __SHA_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "../runtime/sandboxrt_crypto.h"
+#define SHA256_DIGEST_LENGTH SHA256_BLOCK_SIZE
+void SHA256_Init(SHA256_CTX *ctx);
+void SHA256_Update(SHA256_CTX *ctx, const void *data, size_t len);
+void SHA256_Final(unsigned char *md, SHA256_CTX *ctx);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif