def start

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/blake/blake2b.bend:177

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

177# v[0..7] := h[0..7]; v[8..15] := IV[0..7]; v[12] ^= t mod 2^64;
178# v[13] ^= t >> 64; if last block, v[14] := ~v[14].
179def start(h: T.Chain, t: T.Counter, last: Bool) -> T.State:
180  match h t:
181    case T.H{h0,h1,h2,h3,h4,h5,h6,h7} T.C{t0,t1,t2,t3}:
182      T.V{h0,h1,h2,h3,h4,h5,h6,h7,iv(0n),iv(1n),iv(2n),iv(3n),xor(iv(4n),T.W{t0,t1}),xor(iv(5n),T.W{t2,t3}),invert_if(last,iv(6n)),iv(7n)}

Uses (8)

Used by (5)