def xor_front
import bend-collections@1.0.0.0/src/crypto/chacha/chacha20.bend as Chacha20import Base
66# XOR the keystream onto the front of xs, as far as both go.
67def xor_front(ks: List<&2, U32>, xs: List<&2, U32>) -> List<&2, U32>:
68 match ks xs:
69 case k <> kt x <> xt: U32.xor(x, k) <> xor_front(kt, xt)
70 case _ _: Nil{}