summaryrefslogtreecommitdiff
path: root/util/sbase/sha384.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/sbase/sha384.h')
-rw-r--r--util/sbase/sha384.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/sbase/sha384.h b/util/sbase/sha384.h
new file mode 100644
index 00000000..2ab9bc49
--- /dev/null
+++ b/util/sbase/sha384.h
@@ -0,0 +1,16 @@
+/* public domain sha512 implementation based on fips180-3 */
+
+#include "sha512.h"
+
+#define sha384 sha512 /*struct*/
+
+enum { SHA384_DIGEST_LENGTH = 48 };
+
+/* reset state */
+void sha384_init(void *ctx);
+/* process message */
+#define sha384_update sha512_update
+/* get message digest */
+/* state is ruined after sum, keep a copy if multiple sum is needed */
+/* part of the message might be left in s, zero it if secrecy is needed */
+void sha384_sum(void *ctx, uint8_t md[SHA384_DIGEST_LENGTH]);