def initial

bend-collections-laws-crypto@1.0.0.0 · spec/math/random/chacha8rand.bend:100

import bend-collections-laws-crypto@1.0.0.0/spec/math/random/chacha8rand.bend as Chacha8rand
import Base

100# RFC 8439 2.3: constants, key (eight words), block counter, nonce (here zero)
101def initial(key: List<&2, U32>, +ctr: U32) -> List<&2, U32>:
102  match key:
103    case [k0, k1, k2, k3, k4, k5, k6, k7]:
104      [1634760805, 857760878, 2036477234, 1797285236, k0, k1, k2, k3, k4, k5, k6, k7, ctr, 0, 0, 0]
105    case _:
106      []

Uses (2)

Used by (4)