summaryrefslogtreecommitdiff
path: root/packages/moxiebox/sha256_wrap.c
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-12-01 21:00:50 (GMT)
committerGitHub <noreply@github.com>2018-12-01 21:00:50 (GMT)
commitdc681ec8eb53eccdd18521853abaf0574d6ae75f (patch)
tree67532a4e3a2498ab5663bb400649ec847ced6ba7 /packages/moxiebox/sha256_wrap.c
parent951afda5088f202eead14e3ae281f234b160af0b (diff)
parent40d5bf64408a0e103f8149f941ea50fbbb11dc91 (diff)
Merge pull request #1102 from stilor/moxie
Moxie architecture support
Diffstat (limited to 'packages/moxiebox/sha256_wrap.c')
-rw-r--r--packages/moxiebox/sha256_wrap.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/moxiebox/sha256_wrap.c b/packages/moxiebox/sha256_wrap.c
new file mode 100644
index 0000000..15800c4
--- /dev/null
+++ b/packages/moxiebox/sha256_wrap.c
@@ -0,0 +1,25 @@
+/*
+ Wrapper around moxiebox'es implementation of SHA256 digest that
+ mimics the API of the OpenSSL implementation.
+*/
+
+#include "sha.h"
+#include "../runtime/sha256.c"
+
+void
+SHA256_Init(SHA256_CTX *ctx)
+{
+ sha256_init(ctx);
+}
+
+void
+SHA256_Update(SHA256_CTX *ctx, const void *data, size_t len)
+{
+ sha256_update(ctx, data, len);
+}
+
+void
+SHA256_Final(unsigned char *md, SHA256_CTX *ctx)
+{
+ sha256_final(ctx, md);
+}