def chunks
bend-collections@1.0.0.0 · src/crypto/blake/blake3/blake3.bend:178
import bend-collections@1.0.0.0/src/crypto/blake/blake3/blake3.bend as Blake3
import Base
import bend-collections@1.0.0.0/src/crypto/blake/blake3/types.bend as T
178
179def chunks(n: Nat, +counter: U32, +index: U32, +len: Nat, pair: Array<U32> & Stack) -> T.Out:
180 match n pair:
181 case 0n Tuple{a,s}: finish(s,Pair.snd(Array<U32>,T.Out,last_chunk(a,counter,index,len)))
182 case 1n+p Tuple{a,s}: chunks(p,U32.inc(counter),U32.add(index,256),len,pushed(s,full_chunk(a,counter,index)))