X25519.valid_bytes: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/curve25519/x25519.bend as X25519 Lines 128-142 of bend-collections@1.0.0.0/src/crypto/curve25519/x25519.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/x25519.bend&start_line=128&end_line=142 import Base # 32 values, each below 256 def valid_bytes(n: Nat, xs: List<&2, U32>) -> Bool: match n: case 0n: match xs: case Nil{}: True{} case Con{x, xt}: False{} case 1n+m: match xs: case Nil{}: False{} case Con{x, xt}: Bool.and(U32.is_lt(x, 256), valid_bytes(m, xt)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt