summaryrefslogtreecommitdiffstats
path: root/src/sha256.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-18 16:18:20 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-18 16:18:20 +0200
commit6d8aa57c0248d7da1cb2cf3fc3516d785bd4db54 (patch)
tree03c6d4d2229259e78e0b824932282e9e90ec2346 /src/sha256.h
parent5a025b23be351560065f9f880ddea7f787bba90a (diff)
downloadfastd-6d8aa57c0248d7da1cb2cf3fc3516d785bd4db54.tar
fastd-6d8aa57c0248d7da1cb2cf3fc3516d785bd4db54.zip
Generalize SHA256 functions to work with arbitrary inputs
Diffstat (limited to 'src/sha256.h')
-rw-r--r--src/sha256.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sha256.h b/src/sha256.h
index 7f29593..a1b27a8 100644
--- a/src/sha256.h
+++ b/src/sha256.h
@@ -28,6 +28,7 @@
#define _FASTD_SHA256_H_
#include <stdbool.h>
+#include <stddef.h>
#include <stdint.h>
@@ -49,7 +50,11 @@ typedef union fastd_sha256 {
void fastd_sha256_blocks(fastd_sha256_t *out, ...);
+void fastd_sha256(fastd_sha256_t *out, const uint32_t *in, size_t len);
+
void fastd_hmacsha256_blocks(fastd_sha256_t *out, const uint32_t key[FASTD_HMACSHA256_KEY_WORDS], ...);
bool fastd_hmacsha256_blocks_verify(const uint8_t mac[FASTD_SHA256_HASH_BYTES], const uint32_t key[FASTD_HMACSHA256_KEY_WORDS], ...);
+void fastd_hmacsha256(fastd_sha256_t *out, const uint32_t key[FASTD_HMACSHA256_KEY_WORDS], const uint32_t *in, size_t len);
+bool fastd_hmacsha256_verify(const uint8_t mac[FASTD_SHA256_HASH_BYTES], const uint32_t key[FASTD_HMACSHA256_KEY_WORDS], const uint32_t *in, size_t len);
#endif /* _FASTD_SHA256_H_ */