p3_keccak/
fallback.rs

1//! This module should be included only when none of the more target-specific implementations are
2//! available. It fills in a few things based on a pure Rust implementation of Keccak.
3
4use core::mem::transmute;
5
6use p3_symmetric::{CryptographicPermutation, Permutation};
7
8use crate::KeccakF;
9
10pub const VECTOR_LEN: usize = 1;
11
12impl Permutation<[[u64; VECTOR_LEN]; 25]> for KeccakF {
13    fn permute_mut(&self, input: &mut [[u64; VECTOR_LEN]; 25]) {
14        let input: &mut [u64; 25] = unsafe { transmute(input) };
15        self.permute_mut(input);
16    }
17}
18
19impl CryptographicPermutation<[[u64; VECTOR_LEN]; 25]> for KeccakF {}