def blocks

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/blake/blake2s.bend:186

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/blake/blake2s.bend as Blake2s
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake2s/types.bend as T

186# n full blocks, then the last one; t counts the bytes compressed so far.
187def blocks(+r: Nat, n: Nat, +base: U32, +t0: U32, t1: U32, +remain: Nat, pair: Array<U32> & T.State) -> T.State:
188  match n pair:
189    case 0n Tuple{a, h}: finish(r, a, base, t0, t1, remain, h)
190    case 1n+p Tuple{a, h}:
191      +c0 = U32.add(t0, 64)
192      +c1 = count_hi(t0, t1, 64)
193      blocks(r, p, U32.add(base, 16), c0, c1, remain, absorb(r, a, base, h, c0, c1))

Uses (10)

Used by (5)