def rekey

bend-collections-laws-crypto@1.0.0.0 · src/math/random/chacha8.bend:45

import bend-collections-laws-crypto@1.0.0.0/src/math/random/chacha8.bend as Chacha8
import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W
import bend-collections-laws-crypto@1.0.0.0/src/math/random/chacha8/block.bend as B

45# the key of the next iteration: the last four words of the last group
46def rekey(l: List<&2, W.U64>) -> B.Key:
47  match l:
48    case [W.U64{k0, k1}, W.U64{k2, k3}, W.U64{k4, k5}, W.U64{k6, k7}]:
49      B.K{k0, k1, k2, k3, k4, k5, k6, k7}
50    case _:
51      B.K{0, 0, 0, 0, 0, 0, 0, 0}

Uses (3)

Used by (2)