def chacha8
import bend-collections-laws-crypto@1.0.0.0/spec/math/random/chacha8rand.bend as Chacha8randimport Base
115# the ChaCha8 block function: eight rounds, then the input added back
116def chacha8(+key: List<&2, U32>, +ctr: U32) -> List<&2, U32>:
117 add_words(double_rounds(4n, initial(key, ctr)), initial(key, ctr))