def group
import bend-collections-laws-crypto@1.0.0.0/spec/math/random/chacha8rand.bend as Chacha8randimport Base
139# the blocks g, g + 1, g + 2, g + 3, permuted
140def group(+key: List<&2, U32>, +g: U32) -> List<&2, U32>:
141 interleave(16n, 0n, c2sp_block(key, g), c2sp_block(key, U32.add(g, 1)), c2sp_block(key, U32.add(g, 2)), c2sp_block(key, U32.add(g, 3)))