def xor_front
import bend-collections-laws-crypto@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{}
Uses (3)
Used by (4)
- bend-collections-laws-crypto@1.0.0.0/src/crypto/chacha/chacha20:stream
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/chacha/stream:front_correct
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/chacha/stream:stream_correct
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/chacha/stream:xor_front_eq