def init
import bend-collections@1.0.0.0/src/math/random/chacha8/block.bend as Blockimport Base
26# the initial state: constants, key, 32-bit block counter, zero nonce
27def init(k: Key, +ctr: U32) -> Vector:
28 match k:
29 case K{k0,k1,k2,k3,k4,k5,k6,k7}:
30 V{1634760805,857760878,2036477234,1797285236,k0,k1,k2,k3,k4,k5,k6,k7,ctr,0,0,0}