aboutsummaryrefslogtreecommitdiff
path: root/c/blake3_dispatch.c
diff options
context:
space:
mode:
authorSamuel Neves <[email protected]>2020-08-14 16:54:14 +0100
committerSamuel Neves <[email protected]>2020-08-14 16:54:14 +0100
commit01f283243af22467b161859e7c38df7d29908b63 (patch)
tree37b73b9f9ed524bf8fad709792370a4bd2cb401e /c/blake3_dispatch.c
parent9c39b3b3951534246ac9216bcb5ee7f4a1f4c30b (diff)
integrate with c codexof
Diffstat (limited to 'c/blake3_dispatch.c')
-rw-r--r--c/blake3_dispatch.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/c/blake3_dispatch.c b/c/blake3_dispatch.c
index 6847725..a748968 100644
--- a/c/blake3_dispatch.c
+++ b/c/blake3_dispatch.c
@@ -175,6 +175,23 @@ void blake3_compress_xof(const uint32_t cv[8],
blake3_compress_xof_portable(cv, block, block_len, counter, flags, out);
}
+
+void blake3_xof_many(const uint32_t cv[8],
+ const uint8_t block[BLAKE3_BLOCK_LEN],
+ uint8_t block_len, uint64_t counter, uint8_t flags,
+ uint8_t out[64], size_t outblocks) {
+#if defined(IS_X86)
+ const enum cpu_feature features = get_cpu_features();
+#if !defined(BLAKE3_NO_AVX512)
+ if (features & AVX512VL) {
+ blake3_xof_many_avx512(cv, block, block_len, counter, flags, out, outblocks);
+ return;
+ }
+#endif
+#endif
+ blake3_xof_many_portable(cv, block, block_len, counter, flags, out, outblocks);
+}
+
void blake3_hash_many(const uint8_t *const *inputs, size_t num_inputs,
size_t blocks, const uint32_t key[8], uint64_t counter,
bool increment_counter, uint8_t flags,