def i2osp_le
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend as Curveimport Base
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as C
203# I2OSP: the n low bytes of x, big-endian
204def i2osp_le(n: Nat, +x: Nat) -> List<&2, U32>:
205 match n:
206 case 0n: Nil{}
207 case 1n+k: U32.from_nat(C.low(8n, x)) <> i2osp_le(k, C.high(8n, x))