diff options
author | Paul Duncan <pabs@pablotron.org> | 2024-04-29 18:34:32 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2024-04-29 18:34:32 -0400 |
commit | 7bb7d04b4561545d3be1c82abfb87bd01b28a0c1 (patch) | |
tree | 3e4efb5c096415e1bccafa8b9493dd4f09ffe336 /sha3.c | |
parent | 5e1d35c63378a8e509287e49aca3566a08fdcf1d (diff) | |
download | sha3-7bb7d04b4561545d3be1c82abfb87bd01b28a0c1.tar.bz2 sha3-7bb7d04b4561545d3be1c82abfb87bd01b28a0c1.zip |
sha3.[hc]: add sha3_backend()
Diffstat (limited to 'sha3.c')
-rw-r--r-- | sha3.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -751,7 +751,6 @@ static inline size_t absorb12(sha3_state_t * const a, size_t num_bytes, const si return num_bytes; } - // Get rate (number of bytes that can be absorbed before the internal // state is permuted). // @@ -2094,6 +2093,15 @@ void k12_once(const uint8_t *src, const size_t src_len, uint8_t *dst, const size k12_custom_once(src, src_len, NULL, 0, dst, dst_len); } +// Return backend name. +const char *sha3_backend(void) { +#if SHA3_BACKEND == SHA3_BACKEND_AVX512 + return "avx512"; +#elif SHA3_BACKEND == SHA3_BACKEND_SCALAR + return "scalar"; +#endif /* SHA3_BACKEND */ +} + #ifdef SHA3_TEST #include <stdio.h> // printf() #include <stdlib.h> // malloc() (used in test_kangarootwelve()) |