Skip to main content

hash_chains_varlen_32_trunc16

Function hash_chains_varlen_32_trunc16 

Source
pub fn hash_chains_varlen_32_trunc16(
    mode: Mode<'_>,
    init: &[[u8; 32]],
    steps: &[u32],
    out: &mut [[u8; 16]],
)
Expand description

Variable-step counterpart to hash_chains_32_trunc16 that advances chain i by steps[i] iterations in mode and writes its final 16-byte state to out[i] (uses stack storage up to 128 nonzero chains; allocates a call-local Vec<usize> above 128; #584).

Internally schedules a longest-processing-time-first (LPT) continuous lane-refilling work queue over fused multi-step SIMD bursts at the platform’s native width, keeping SIMD lanes busy across heterogeneous verification chains without exposing ISA lane widths to callers. Uses stack storage when at most 128 chains have steps[i] > 0, and spills to a call-local Vec<usize> sized by the nonzero count (freed on return) above 128 nonzero chains. Work depends only on init.len() and steps, never on keys or chain values.

Panics if init.len() != steps.len() or init.len() != out.len().