Skip to content

Commit

Permalink
add NEON support to blake3_dispatch.c
Browse files Browse the repository at this point in the history
Currently this requires setting the BLAKE3_USE_NEON preprocessor flag.
In the future we may enable this automatically on AArch32/64 or include
some kind of dynamic feature detection. (Though ARM makes this harder
than x86.)

Closes #30.
  • Loading branch information
oconnor663 committed Jan 28, 2020
1 parent d7a37fa commit 201634e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions c/blake3_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ void blake3_hash_many(const uint8_t *const *inputs, size_t num_inputs,
}
#endif
#endif

#if defined(IS_ARM) && defined(BLAKE3_USE_NEON)
blake3_hash_many_neon(inputs, num_inputs, blocks, key, counter,
increment_counter, flags, flags_start, flags_end, out);
return;
#endif

blake3_hash_many_portable(inputs, num_inputs, blocks, key, counter,
increment_counter, flags, flags_start, flags_end,
out);
Expand Down

0 comments on commit 201634e

Please sign in to comment.