def bytes_le
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend as Bytesimport Base
20# little-endian bytes of limbs below 2^16
21def bytes_le(xs: List<&2, Nat>) -> List<&2, U32>:
22 match xs:
23 case Nil{}: Nil{}
24 case +x <> t: U32.from_nat(Nat.mod(x, 256n)) <> U32.from_nat(Nat.div(x, 256n)) <> bytes_le(t)