p3_keccak_air/
lib.rs

1//! An AIR for the Keccak-f permutation. Assumes the field size is between 2^16 and 2^32.
2
3#![no_std]
4
5extern crate alloc;
6
7mod air;
8mod columns;
9mod constants;
10mod generation;
11mod round_flags;
12
13pub use air::*;
14pub use columns::*;
15pub use constants::*;
16pub use generation::*;
17
18/// Total number of Keccak-f rounds.
19pub const NUM_ROUNDS: usize = 24;
20
21/// Number of Keccak-f rounds minus one.
22pub const NUM_ROUNDS_MIN_1: usize = NUM_ROUNDS - 1;
23
24/// Number of bits in each limb used to represent 64-bit words.
25const BITS_PER_LIMB: usize = 16;
26
27/// Number of limbs needed to represent a 64-bit word.
28///
29/// Computed as 64 divided by the number of bits per limb.
30pub const U64_LIMBS: usize = 64 / BITS_PER_LIMB;
31
32/// Number of rate bits in Keccak-f.
33///
34/// In Keccak-f[1600], the "rate" parameter for absorbing and squeezing is 1088 bits.
35const RATE_BITS: usize = 1088;
36
37/// Number of limbs needed to represent the rate portion of the state.
38///
39/// Computed as rate bits divided by bits per limb.
40const RATE_LIMBS: usize = RATE_BITS / BITS_PER_LIMB;