tiny_keccak/
keccakf.rs

1use crate::{Buffer, Permutation};
2
3const ROUNDS: usize = 24;
4
5const RC: [u64; ROUNDS] = [
6    1u64,
7    0x8082u64,
8    0x800000000000808au64,
9    0x8000000080008000u64,
10    0x808bu64,
11    0x80000001u64,
12    0x8000000080008081u64,
13    0x8000000000008009u64,
14    0x8au64,
15    0x88u64,
16    0x80008009u64,
17    0x8000000au64,
18    0x8000808bu64,
19    0x800000000000008bu64,
20    0x8000000000008089u64,
21    0x8000000000008003u64,
22    0x8000000000008002u64,
23    0x8000000000000080u64,
24    0x800au64,
25    0x800000008000000au64,
26    0x8000000080008081u64,
27    0x8000000000008080u64,
28    0x80000001u64,
29    0x8000000080008008u64,
30];
31
32keccak_function!("`keccak-f[1600, 24]`", keccakf, ROUNDS, RC);
33
34pub struct KeccakF;
35
36impl Permutation for KeccakF {
37    fn execute(buffer: &mut Buffer) {
38        keccakf(buffer.words());
39    }
40}