Skip to main content

Module blake3

Module blake3 

Source
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.