pub fn hash_counter_range_trunc16(
mode: Mode<'_>,
template: &[u8],
counter_word: usize,
start: u32,
out: &mut [[u8; 16]],
)Expand description
Hash out.len() single-block messages derived from template (4..=64
bytes) in mode, replacing the 4-byte little-endian word at byte offset
counter_word * 4 with start.wrapping_add(i) (modulo 2^32) for
i in 0..out.len(), writing the first 16 bytes of each BLAKE3 digest.
Identical to hash_counter_range truncated to 16 bytes, halving output
memory traffic for 128-bit digest callers (such as WOTS/FORS leaf
generation and hash-based signatures).
Panics if template.len() > BLOCK_LEN, counter_word >= 16, or
counter_word * 4 + 4 > template.len() (checked in every build, even
when out is empty).
ยงExample
use blake3_servil_core::{Mode, convenience, throughput};
let mut template = [0u8; 36];
template[..32].fill(0x5c);
let mut digests = [[0u8; 16]; 18];
throughput::hash_counter_range_trunc16(Mode::Plain, &template, 8, 50, &mut digests);
template[32..36].copy_from_slice(&53u32.to_le_bytes());
assert_eq!(digests[3], convenience::hash(&template).as_bytes()[..16]);