Skip to Content
oxcrypto

Keccak

Apply Keccak-f[200], [400], [800], [1600] or Keccak-p rounds.

from oxcrypto.hazmat.permutation.keccak import KECCAK

state = KECCAK.KECCAK_F1600.permute(bytes(200))
turbo = KECCAK.KECCAK_F1600.permute(bytes(200), rounds=12)  # Keccak-p[1600, 12]

The state is 25 lanes in FIPS 202 order, lane x + 5y first, each lane little-endian. rounds selects Keccak-p[b, rounds], the last rounds rounds of Keccak-f[b].

VariantStateRounds
KECCAK_F20025 bytes1 to 18
KECCAK_F40050 bytes1 to 20
KECCAK_F800100 bytes1 to 22
KECCAK_F1600200 bytes1 to 24
StandardFIPS 202 section 3 (Final); Keccak-p[1600, 12] is used by RFC 9861
Cratekeccak 0.2.2 (RustCrypto sponges), pre-1.0 release
AuditNo published audit
MSRV1.85, builds with the project MSRV 1.88
ExperimentalNo
Test vectorsXKCP KeccakF-*-IntermediateValues.txt; Keccak-p rounds cross-checked against SHAKE128 and TurboSHAKE128