summaryrefslogtreecommitdiffstats
path: root/libmincrypt/includes/mincrypt/sha.h
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-11-02 21:25:14 +0100
committerDees Troy <dees_troy@teamw.in>2013-11-02 21:43:26 +0100
commitbb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6 (patch)
tree9c28e5243024d0755d15e981a21f2fbb35a41ead /libmincrypt/includes/mincrypt/sha.h
parentUpdate licenses to all match (diff)
parentmerge in klp-release history after reset to klp-dev (diff)
downloadandroid_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.gz
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.bz2
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.lz
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.xz
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.tar.zst
android_bootable_recovery-bb4c0cbc4bdbff65e3c997bc5bd0ad6d6afa19d6.zip
Diffstat (limited to 'libmincrypt/includes/mincrypt/sha.h')
-rw-r--r--libmincrypt/includes/mincrypt/sha.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/libmincrypt/includes/mincrypt/sha.h b/libmincrypt/includes/mincrypt/sha.h
new file mode 100644
index 000000000..120ddcb4f
--- /dev/null
+++ b/libmincrypt/includes/mincrypt/sha.h
@@ -0,0 +1,30 @@
+// Copyright 2005 Google Inc. All Rights Reserved.
+// Author: mschilder@google.com (Marius Schilder)
+
+#ifndef SECURITY_UTIL_LITE_SHA1_H__
+#define SECURITY_UTIL_LITE_SHA1_H__
+
+#include <stdint.h>
+#include "hash-internal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+typedef HASH_CTX SHA_CTX;
+
+void SHA_init(SHA_CTX* ctx);
+void SHA_update(SHA_CTX* ctx, const void* data, int len);
+const uint8_t* SHA_final(SHA_CTX* ctx);
+
+// Convenience method. Returns digest address.
+// NOTE: *digest needs to hold SHA_DIGEST_SIZE bytes.
+const uint8_t* SHA_hash(const void* data, int len, uint8_t* digest);
+
+#define SHA_DIGEST_SIZE 20
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // SECURITY_UTIL_LITE_SHA1_H__