diff options
| author | Jack O'Connor <[email protected]> | 2023-05-28 19:36:32 +0200 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2024-08-15 16:02:10 -0700 |
| commit | e74172acc35f599497243946e2f3cb3aa3f83f40 (patch) | |
| tree | 7c417e5e4edc4795a9e0d528929adcf09d9e069e /src/platform.rs | |
| parent | 80b83effbd50425939483e5503b186db4dac4d9d (diff) | |
integrate xof_many with the Rust implementation and with Rust and C tests
Diffstat (limited to 'src/platform.rs')
| -rw-r--r-- | src/platform.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/platform.rs b/src/platform.rs index 79bc9a3..1858add 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -277,6 +277,26 @@ impl Platform { } } + pub fn xof_many( + &self, + cv: &CVWords, + block: &[u8; BLOCK_LEN], + block_len: u8, + counter: u64, + flags: u8, + out: &mut [u8], + ) { + match self { + // Safe because detect() checked for platform support. + #[cfg(blake3_avx512_ffi)] + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + Platform::AVX512 => unsafe { + crate::avx512::xof_many(cv, block, block_len, counter, flags, out) + }, + _ => crate::portable::xof_many(cv, block, block_len, counter, flags, out), + } + } + // Explicit platform constructors, for benchmarks. pub fn portable() -> Self { |
