summaryrefslogtreecommitdiff
path: root/sha3.h
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2023-09-03 10:45:38 -0400
committerPaul Duncan <pabs@pablotron.org>2023-09-03 10:45:38 -0400
commit4bd5db53cde5e7a89281e293c006b048663eaf74 (patch)
tree37b2a7a96ad03449e0946e3b3cbee5bcb70d6426 /sha3.h
parent014759efff33157cb6b817233188bdfe7434138a (diff)
downloadsha3-4bd5db53cde5e7a89281e293c006b048663eaf74.tar.bz2
sha3-4bd5db53cde5e7a89281e293c006b048663eaf74.zip
sha3.[hc]: add tuplehash128(), tuplehash128_xof_{init,squeeze,once}(), and test_tuplehash128
Diffstat (limited to 'sha3.h')
-rw-r--r--sha3.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sha3.h b/sha3.h
index a2014c9..864772a 100644
--- a/sha3.h
+++ b/sha3.h
@@ -74,6 +74,24 @@ _Bool kmac256_xof_absorb(sha3_xof_t * const xof, const uint8_t * const msg, cons
void kmac256_xof_squeeze(sha3_xof_t * const xof, uint8_t * const dst, const size_t len);
void kmac256_xof_once(const kmac_params_t params, const uint8_t * const src, const size_t src_len, uint8_t * const dst, const size_t dst_len);
+typedef struct {
+ const uint8_t *ptr;
+ size_t len;
+} tuplehash_str_t;
+
+typedef struct {
+ const tuplehash_str_t *strs; // strings
+ const size_t num_strs; // number of strings
+ const uint8_t *custom; // customization string
+ const size_t custom_len; // length of customization string, in bytes
+} tuplehash_params_t;
+
+void tuplehash128(const tuplehash_params_t params, uint8_t *dst, const size_t dst_len);
+
+void tuplehash128_xof_init(sha3_xof_t * const xof, const tuplehash_params_t params);
+void tuplehash128_xof_squeeze(sha3_xof_t * const xof, uint8_t *dst, const size_t dst_len);
+void tuplehash128_xof_once(const tuplehash_params_t params, uint8_t *dst, const size_t dst_len);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */