| 1 |
use crate::{Buffer, Permutation}; |
| 2 |
|
| 3 |
const ROUNDS: usize = 12; |
| 4 |
|
| 5 |
const RC: [u64; ROUNDS] = [ |
| 6 |
0x000000008000808b, |
| 7 |
0x800000000000008b, |
| 8 |
0x8000000000008089, |
| 9 |
0x8000000000008003, |
| 10 |
0x8000000000008002, |
| 11 |
0x8000000000000080, |
| 12 |
0x000000000000800a, |
| 13 |
0x800000008000000a, |
| 14 |
0x8000000080008081, |
| 15 |
0x8000000000008080, |
| 16 |
0x0000000080000001, |
| 17 |
0x8000000080008008, |
| 18 |
]; |
| 19 |
|
| 20 |
keccak_function!("`keccak-p[1600, 12]`", keccakp, ROUNDS, RC); |
| 21 |
|
| 22 |
pub struct KeccakP; |
| 23 |
|
| 24 |
impl Permutation for KeccakP { |
| 25 |
fn execute(buffer: &mut Buffer) { |
| 26 |
keccakp(buffer.words()); |
| 27 |
} |
| 28 |
} |