summaryrefslogtreecommitdiffstats
path: root/sha256.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:12:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:12:14 +0000
commit4b8a0f3f3dcf60dac2ce308ea08d413a535af29f (patch)
tree0f09c0ad2a4d0f535d89040a63dc3a866a6606e6 /sha256.h
parentInitial commit. (diff)
downloadreprepro-4b8a0f3f3dcf60dac2ce308ea08d413a535af29f.tar.xz
reprepro-4b8a0f3f3dcf60dac2ce308ea08d413a535af29f.zip
Adding upstream version 5.4.4.upstream/5.4.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sha256.h')
-rw-r--r--sha256.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sha256.h b/sha256.h
new file mode 100644
index 0000000..50c1638
--- /dev/null
+++ b/sha256.h
@@ -0,0 +1,20 @@
+#ifndef REPREPRO_SHA256_H
+#define REPREPRO_SHA256_H
+
+/* Structure to save state of computation between the single steps. */
+struct SHA256_Context
+{
+ uint32_t H[8];
+
+ uint64_t total;
+ uint32_t buflen;
+ char buffer[128]; /* NB: always correctly aligned for uint32_t. */
+};
+
+#define SHA256_DIGEST_SIZE 32
+
+void SHA256Init(/*@out@*/struct SHA256_Context *context);
+void SHA256Update(struct SHA256_Context *context, const uint8_t *data, size_t len);
+void SHA256Final(struct SHA256_Context *context, /*@out@*/uint8_t digest[SHA256_DIGEST_SIZE]);
+
+#endif