Expand description
Legacy Keccak-256 primitives for the HashSigsRS compatibility profile.
This crate deliberately implements Keccak-256, whose final partial block
uses the legacy 0x01 domain byte. It does not implement FIPS 202
SHA3-256, whose corresponding byte is 0x06. Confusing those encodings
produces unrelated digests and therefore incompatible HashSigs keys and
signatures.
The hardware-facing foundation is split into three layers:
keccak_roundis one fully combinationalKeccak-f[1600]round. Its rotation offsets and lane destinations are compile-time constants.keccak_f1600composes all 24 rounds and is useful as a correctness oracle and an RTL generation target. It is not the intended area-efficient implementation.IterativeKeccakstores one 1,600-bit state and applies one round per cycle. A request accepted whileIterativeOutput::readyis true emits a one-cycleIterativeOutput::donepulse after exactly 24 round cycles.
LegacyKeccak256 is a software/block-packing model used by tests and by
downstream schedulers. It exposes 136-byte rate blocks in the same
little-endian lane order consumed by the RHDL absorption kernel. This keeps
variable-length byte buffering out of the permutation core while covering
every HashSigs message size (32, 35, 64, and 2,144 bytes).
§Evidence boundary
The tests exercise the Rust model, RHDL VM, lowered RTL VM, and emitted Verilog in Icarus. No synthesis, utilization, timing, route, or physical hardware claim follows from those tests.
Re-exports§
pub use permutation::keccak_f1600;pub use round::keccak_round;pub use round::keccak_round_00;pub use round::keccak_round_01;pub use round::keccak_round_02;pub use round::keccak_round_03;pub use round::keccak_round_04;pub use round::keccak_round_05;pub use round::keccak_round_06;pub use round::keccak_round_07;pub use round::keccak_round_08;pub use round::keccak_round_09;pub use round::keccak_round_10;pub use round::keccak_round_11;pub use round::keccak_round_12;pub use round::keccak_round_13;pub use round::keccak_round_14;pub use round::keccak_round_15;pub use round::keccak_round_16;pub use round::keccak_round_17;pub use round::keccak_round_18;pub use round::keccak_round_19;pub use round::keccak_round_20;pub use round::keccak_round_21;pub use round::keccak_round_22;pub use round::keccak_round_23;pub use sponge::absorb_rate_block;pub use sponge::xor_rate_block;
Structs§
- Iterative
Input - Request presented to
IterativeKeccak. - Iterative
Keccak - A synthesizable
Keccak-f[1600]engine that reuses one round cell. - Iterative
Output - Status and result produced by
IterativeKeccak. - Legacy
Keccak256 - Host-side legacy Keccak-256 sponge and block-packing model.
- Rate
Block - One 1,088-bit Keccak-256 absorption block.
Constants§
- LEGACY_
DOMAIN_ BYTE - Domain byte used by legacy Keccak padding.
- RATE_
BYTES - Keccak-256’s byte rate (
1600 - 2*256bits). - RATE_
LANES - Keccak-256’s rate expressed as 64-bit lanes.
- ROTATION_
OFFSETS Keccak-f[1600]Rho offsets indexed as[x][y].- ROUND_
CONSTANTS - The 24
Keccak-f[1600]Iota constants, in round order. - ROUND_
COUNT - Number of rounds in
Keccak-f[1600].
Functions§
- absorb_
rate_ block - XOR one complete rate block into a state and permute it.
- digest_
from_ state - Extract the first 256 rate bits as a Keccak digest.
- generate_
iterative_ verilog - Generate the 24-cycle iterative engine and its RHDL-owned storage modules.
- generate_
permutation_ verilog - Generate a standalone 24-round combinational permutation module.
- generate_
round_ verilog - Generate a standalone combinational one-round Verilog module.
- keccak_
f1600 - Apply all 24
Keccak-f[1600]rounds as one combinational RHDL kernel. - keccak_
round - Apply one
Keccak-f[1600]round selected at runtime. - keccak_
round_ 00 - Apply compile-time
Keccak-f[1600]round 0. - keccak_
round_ 01 - Apply compile-time
Keccak-f[1600]round 1. - keccak_
round_ 02 - Apply compile-time
Keccak-f[1600]round 2. - keccak_
round_ 03 - Apply compile-time
Keccak-f[1600]round 3. - keccak_
round_ 04 - Apply compile-time
Keccak-f[1600]round 4. - keccak_
round_ 05 - Apply compile-time
Keccak-f[1600]round 5. - keccak_
round_ 06 - Apply compile-time
Keccak-f[1600]round 6. - keccak_
round_ 07 - Apply compile-time
Keccak-f[1600]round 7. - keccak_
round_ 08 - Apply compile-time
Keccak-f[1600]round 8. - keccak_
round_ 09 - Apply compile-time
Keccak-f[1600]round 9. - keccak_
round_ 10 - Apply compile-time
Keccak-f[1600]round 10. - keccak_
round_ 11 - Apply compile-time
Keccak-f[1600]round 11. - keccak_
round_ 12 - Apply compile-time
Keccak-f[1600]round 12. - keccak_
round_ 13 - Apply compile-time
Keccak-f[1600]round 13. - keccak_
round_ 14 - Apply compile-time
Keccak-f[1600]round 14. - keccak_
round_ 15 - Apply compile-time
Keccak-f[1600]round 15. - keccak_
round_ 16 - Apply compile-time
Keccak-f[1600]round 16. - keccak_
round_ 17 - Apply compile-time
Keccak-f[1600]round 17. - keccak_
round_ 18 - Apply compile-time
Keccak-f[1600]round 18. - keccak_
round_ 19 - Apply compile-time
Keccak-f[1600]round 19. - keccak_
round_ 20 - Apply compile-time
Keccak-f[1600]round 20. - keccak_
round_ 21 - Apply compile-time
Keccak-f[1600]round 21. - keccak_
round_ 22 - Apply compile-time
Keccak-f[1600]round 22. - keccak_
round_ 23 - Apply compile-time
Keccak-f[1600]round 23. - software_
keccak_ f1600 - Independent native-Rust
Keccak-f[1600]permutation. - software_
keccak_ round - Independent native-Rust implementation of one
Keccak-f[1600]round. - xor_
rate_ block - XOR one complete rate block into the 17 rate lanes of a state.
Type Aliases§
- Digest
- A 256-bit Keccak digest in byte order.
- Keccak
State - A
Keccak-f[1600]state in the canonicalx + 5*ylane order.