Expand description
BLAKE3 circuit gadgets.
This module provides circuit primitives for the BLAKE3 hash function. The primitives are exposed as free functions that take input wires and return output wires — no wrapping structs.
The entry points are:
blake3_compress— single-block compression primitive, its rounds split across the two 32-bit lanes.blake3_compress_2x_seq— two sequential compressions sharing one parallel core.blake3_chunk— single-chunk (up to 16 blocks) chaining-value gadget.blake3_fixed— full hash gadget for messages of compile-time-known length, spanning any number of chunks via BLAKE3’s parent tree.blake3_keyed_fixed— the same gadget in BLAKE3’s keyed mode.blake3_keyed_fixed_2x— two keyed hashes of equal-length messages, run side by side.
Re-exports§
pub use compress::Blake3Compress2x;pub use compress::blake3_compress;pub use compress::blake3_compress_2x;pub use compress::blake3_compress_2x_seq;pub use compress::ref_compress;
Modules§
- compress
- BLAKE3 compression primitive.
Constants§
- BLOCK_
BYTES - Byte length of a BLAKE3 block.
- CHUNK_
BYTES - Byte length of a BLAKE3 chunk.
- CHUNK_
END - CHUNK_
START - DERIVE_
KEY_ CONTEXT - DERIVE_
KEY_ MATERIAL - IV
- BLAKE3 initial chaining value. Same as the SHA-256 IV.
- KEYED_
HASH - KEY_
BYTES - Byte length of a BLAKE3 key.
- MSG_
SCHEDULE - Message schedule for each of the 7 rounds of the BLAKE3 compression function.
- PARENT
- ROOT
Functions§
- blake3_
chunk - Computes the BLAKE3 chaining value of a single chunk.
- blake3_
fixed - Computes the BLAKE3 hash of a compile-time fixed-length message.
- blake3_
keyed_ fixed - Computes the keyed BLAKE3 hash of a compile-time fixed-length message.
- blake3_
keyed_ fixed_ 2x - Computes two keyed BLAKE3 hashes of equal-length messages side by side.