tiny_keccak/
keccakp.rs

1use crate::{Buffer, Permutation};
2
3const ROUNDS: usize = 12;
4
5const 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
20keccak_function!("`keccak-p[1600, 12]`", keccakp, ROUNDS, RC);
21
22pub struct KeccakP;
23
24impl Permutation for KeccakP {
25    fn execute(buffer: &mut Buffer) {
26        keccakp(buffer.words());
27    }
28}