def bytes_ok
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/field.bend as Fieldimport Base
41# n values, each below 2^8
42def bytes_ok(n: Nat, xs: List<&2, U32>) -> Bool:
43 match n:
44 case 0n:
45 match xs:
46 case Nil{}:
47 True{}
48 case Con{x, xt}:
49 False{}
50 case 1n+m:
51 match xs:
52 case Nil{}:
53 False{}
54 case Con{x, xt}:
55 Bool.and(Nat.is_lt(U32.to_nat(x), 256n), bytes_ok(m, xt))
Uses (7)
Used by (18)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/field:tight
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/proof:valid_eq
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/limbs:bytes_okb
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/proof:ok
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/proof:valid_ok
- …