def prefix
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend as Chachaimport Base
130# The first n bytes of a list, and the rest.
131def prefix(n: Nat, xs: List<&2, U32>) -> List<&2, U32>:
132 match n xs:
133 case 0n _: Nil{}
134 case 1n+p Nil{}: Nil{}
135 case 1n+p x <> rest: x <> prefix(p, rest)
Uses (3)
Used by (19)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha:xsubkey
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/chacha/stream:take_eq
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305:open_len
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305:poly_key
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/aead/chacha20poly1305:xkey_eq
- …