orion
orion copied to clipboard
Future use of `core::simd` and moving to SIMD-based vectorized implementations
Portable SIMD has landed in nightly Rust core::simd
[1]. We should investigate if using SIMD in Orion is a viable option. For example, ChaCha20 can be vectorized[2], which could provide quite substantial performance benefits.
What needs to be figured out:
- What is, if there is any, the timeline for stabilization of
core::simd
and potentiallystd::simd
(?) - Will the portable SIMD API require use of
unsafe
code if utilized within Orion? - What other primitives could benefit from vectorization? BLAKE2 is a candidate as well IIRC
- If
simd
would requirestd
for some unknown reason, do we want to consider providing vectorized implementations forsafe-api
only? - Will the portable SIMD offered by Rust be portable enough in the sense that we'd be able to remove the current portable non-vectorized implementations?
- Would the portable SIMD be usable on all platforms we test on currently, including the
non-std
targets? What would the impact on WASM support be here?
[1]: Most of the work seems to happen over here https://github.com/rust-lang/portable-simd [2]: https://eprint.iacr.org/2013/759.pdf