From 72111e7a53eaad7bea841ab8b09e70642bde00ae Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 Aug 2024 18:02:00 +0200 Subject: Add support for Keccak, SHA3, SHAKE, and RawSHAKE via libkeccak>=1.3 (this version introduced zerocopy) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libhashsum_init_hasher.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'libhashsum_init_hasher.c') diff --git a/libhashsum_init_hasher.c b/libhashsum_init_hasher.c index 3f99e6c..3d8a521 100644 --- a/libhashsum_init_hasher.c +++ b/libhashsum_init_hasher.c @@ -36,7 +36,36 @@ libhashsum_init_hasher(struct libhashsum_hasher *this, enum libhashsum_algorithm return libhashsum_init_sha_512_224_hasher(this); case LIBHASHSUM_SHA_512_256: return libhashsum_init_sha_512_256_hasher(this); + case LIBHASHSUM_KECCAK_224: + return libhashsum_init_keccak_224_hasher(this); + case LIBHASHSUM_KECCAK_256: + return libhashsum_init_keccak_256_hasher(this); + case LIBHASHSUM_KECCAK_384: + return libhashsum_init_keccak_384_hasher(this); + case LIBHASHSUM_KECCAK_512: + return libhashsum_init_keccak_512_hasher(this); + case LIBHASHSUM_SHA3_224: + return libhashsum_init_sha3_224_hasher(this); + case LIBHASHSUM_SHA3_256: + return libhashsum_init_sha3_256_hasher(this); + case LIBHASHSUM_SHA3_384: + return libhashsum_init_sha3_384_hasher(this); + case LIBHASHSUM_SHA3_512: + return libhashsum_init_sha3_512_hasher(this); + case LIBHASHSUM_SHAKE128: + return libhashsum_init_shake128_hasher(this, 0); + case LIBHASHSUM_SHAKE256: + return libhashsum_init_shake256_hasher(this, 0); + case LIBHASHSUM_SHAKE512: + return libhashsum_init_shake512_hasher(this, 0); + case LIBHASHSUM_RAWSHAKE128: + return libhashsum_init_rawshake128_hasher(this, 0); + case LIBHASHSUM_RAWSHAKE256: + return libhashsum_init_rawshake256_hasher(this, 0); + case LIBHASHSUM_RAWSHAKE512: + return libhashsum_init_rawshake512_hasher(this, 0); default: + case LIBHASHSUM_KECCAK: errno = EINVAL; return -1; } -- cgit v1.2.3-70-g09d2