aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum_init_hasher_from_string.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-24 20:13:01 +0200
committerMattias Andrée <maandree@kth.se>2024-08-24 20:13:01 +0200
commitfebb5279f7bf3c86ec872c1b2ed1e024f73e64c5 (patch)
treeea6918fc1dcb29e11ce9399b8300a124cc0342cf /libhashsum_init_hasher_from_string.c
parentAdd support for Keccak, SHA3, SHAKE, and RawSHAKE via libkeccak>=1.3 (this version introduced zerocopy) (diff)
downloadlibhashsum-febb5279f7bf3c86ec872c1b2ed1e024f73e64c5.tar.gz
libhashsum-febb5279f7bf3c86ec872c1b2ed1e024f73e64c5.tar.bz2
libhashsum-febb5279f7bf3c86ec872c1b2ed1e024f73e64c5.tar.xz
Add BLAKE via libblake>=1.1 (this version introduced libblake_init())
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libhashsum_init_hasher_from_string.c')
-rw-r--r--libhashsum_init_hasher_from_string.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libhashsum_init_hasher_from_string.c b/libhashsum_init_hasher_from_string.c
index 30526da..9a53864 100644
--- a/libhashsum_init_hasher_from_string.c
+++ b/libhashsum_init_hasher_from_string.c
@@ -180,6 +180,14 @@ libhashsum_init_hasher_from_string(struct libhashsum_hasher *this, const char *a
return with_n(&libhashsum_init_rawshake512_hasher, this, algorithm);
if (equiv(algorithm, "Keccak["))
return with_rcn(&libhashsum_init_keccak_hasher, this, algorithm);
+ if (equiv(algorithm, "BLAKE-224"))
+ return libhashsum_init_blake224_hasher(this);
+ if (equiv(algorithm, "BLAKE-256"))
+ return libhashsum_init_blake256_hasher(this);
+ if (equiv(algorithm, "BLAKE-384"))
+ return libhashsum_init_blake384_hasher(this);
+ if (equiv(algorithm, "BLAKE-512"))
+ return libhashsum_init_blake512_hasher(this);
errno = EINVAL;
return -1;