Skip to main content

ref_compress

Function ref_compress 

Source
pub fn ref_compress(
    h: [u32; 8],
    m: [u32; 16],
    t_lo: u32,
    t_hi: u32,
    last: u32,
) -> [u32; 8]
Expand description

Pure-Rust BLAKE2s compression of a single 64-byte block.

Matches the in-circuit compression exactly, per RFC 7693 Section 3.2.

Used for prover-side witness generation, and as the test reference.

§Arguments

  • h - The 8-word input state.
  • m - The 16-word message block.
  • t_lo - Low 32 bits of the byte counter.
  • t_hi - High 32 bits of the byte counter.
  • last - The finalization flag.

All-ones for the final block, zero otherwise.

§Returns

The updated 8-word state.