def le_bytes
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519.bend as X25519import Base
55# encodeUCoordinate: u mod p as 32 little-endian bytes
56def le_bytes(n: Nat, +x: Nat) -> List<&2, U32>:
57 match n:
58 case 0n:
59 Nil{}
60 case 1n+m:
61 Con{U32.from_nat(Nat.mod(x, 256n)), le_bytes(m, Nat.div(x, 256n))}
Uses (6)
Used by (13)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519:base
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/xbits:bytes_le
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/pdec:base_rel
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519:encode_n
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519:sign_body
- …