def full_go

bend-collections@1.0.0.0 · src/crypto/blake/blake3/blake3.bend:113

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
import bend-collections@1.0.0.0/src/crypto/blake/blake3/compress.bend as C

113# A chunk that is not the last: n more full blocks after the current one, the
114# current block in `pair`; flags is CHUNK_START on the first block and 0 after.
115# Returns the chunk's chaining value.
116def full_go(n: Nat, +counter: U32, +index: U32, +flags: U32, cv: T.CV, pair: Array<U32> & T.Block) -> Array<U32> & T.CV:
117  match n pair:
118    case 0n Tuple{a,b}: (a,C.compress(cv,b,counter,64,U32.or(flags,2)))
119    case 1n+p Tuple{a,b}: full_go(p,counter,U32.add(index,16),0,C.compress(cv,b,counter,64,flags),read_block(a,U32.add(index,16)))

Uses (11)

Used by (1)