From 1f51b90f75b5898ff4a58f15e0f59c71e185b490 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 6 Sep 2023 01:56:23 -0400 Subject: ./sha3.h: add kangarootwelve{,_custom}() --- sha3.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sha3.h') diff --git a/sha3.h b/sha3.h index 51d5025..73fb7e2 100644 --- a/sha3.h +++ b/sha3.h @@ -1291,6 +1291,35 @@ _Bool turboshake256_absorb(turboshake_t *ts, const uint8_t *src, const size_t le */ void turboshake256_squeeze(turboshake_t *ts, uint8_t *dst, const size_t len); +/** + * Initialize internal KangarooTwelve context, absorb `src_len` bytes of + * input from source buffer `src`, then squeeze `dst_len` bytes of + * output into destination buffer `dst`. + * + * @param[in] custom Custom string buffer. + * @param[in] custom_len Custom string length, in bytes. + * @param[in] src Source buffer. + * @param[in] src_len Source buffer length, in bytes. + * @param[out] dst Destination buffer. + * @param[in] dst_len Destination buffer length, in bytes. + */ +void kangarootwelve(const uint8_t *custom, const size_t custom_len, const uint8_t *src, const size_t src_len, uint8_t *dst, const size_t dst_len); + +/** + * Initialize internal KangarooTwelve context with custom string + * `custom` of length `custom_len`, absorb `src_len` bytes of input from + * source buffer `src`, then squeeze `dst_len` bytes of output into + * destination buffer `dst`. + * + * @param[in] custom Custom string buffer. + * @param[in] custom_len Custom string length, in bytes. + * @param[in] src Source buffer. + * @param[in] src_len Source buffer length, in bytes. + * @param[out] dst Destination buffer. + * @param[in] dst_len Destination buffer length, in bytes. + */ +void kangarootwelve_custom(const uint8_t *custom, const size_t custom_len, const uint8_t *src, const size_t src_len, uint8_t *dst, const size_t dst_len); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3