diff options
author | Mattias Andrée <maandree@kth.se> | 2024-08-24 18:02:00 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-08-24 18:02:00 +0200 |
commit | 72111e7a53eaad7bea841ab8b09e70642bde00ae (patch) | |
tree | 016e0326b794f8a5b9cc03139b8a5ab094ed7411 /libhashsum_init_hasher.c | |
parent | Make it possible for libhashsum_state to grow in future versions (diff) | |
download | libhashsum-72111e7a53eaad7bea841ab8b09e70642bde00ae.tar.gz libhashsum-72111e7a53eaad7bea841ab8b09e70642bde00ae.tar.bz2 libhashsum-72111e7a53eaad7bea841ab8b09e70642bde00ae.tar.xz |
Add support for Keccak, SHA3, SHAKE, and RawSHAKE via libkeccak>=1.3 (this version introduced zerocopy)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libhashsum_init_hasher.c | 29 |
1 files changed, 29 insertions, 0 deletions
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; } |