summaryrefslogtreecommitdiff
path: root/source/kit/sha256.h
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-12-29 06:21:33 +0100
committerMitya Selivanov <automainint@guattari.tech>2023-12-29 06:21:33 +0100
commit2d6c8fec45b23a8a28668ecf3ef281139ab778a7 (patch)
tree75d2a8538992129a83c0c2b83688289443d697e5 /source/kit/sha256.h
parent820b171245f2f14766f3accdb0246a4e2c0d596a (diff)
downloadsaw-2d6c8fec45b23a8a28668ecf3ef281139ab778a7.zip
refactor dependencies; include dependencies source code
Diffstat (limited to 'source/kit/sha256.h')
-rw-r--r--source/kit/sha256.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/kit/sha256.h b/source/kit/sha256.h
new file mode 100644
index 0000000..92e9784
--- /dev/null
+++ b/source/kit/sha256.h
@@ -0,0 +1,28 @@
+#ifndef KIT_SHA256_H
+#define KIT_SHA256_H
+
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum { KIT_SHA256_BLOCK_SIZE = 32 };
+
+typedef struct {
+ u8 v[KIT_SHA256_BLOCK_SIZE];
+} kit_sha256_hash_t;
+
+kit_sha256_hash_t kit_sha256(i64 size, u8 *data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef KIT_DISABLE_SHORT_NAMES
+# define SHA256_BLOCK_SIZE KIT_SHA256_BLOCK_SIZE
+# define sha256_hash_t kit_sha256_hash_t
+# define sha256 kit_sha256
+#endif
+
+#endif