def limbs_le

bend-collections@1.0.0.0 · src/crypto/secp256k1/bytes.bend:9

import bend-collections@1.0.0.0/src/crypto/secp256k1/bytes.bend as Bytes
import Base

9# little-endian limbs of little-endian bytes (two bytes per limb)
10def limbs_le(bs: List<&2, U32>) -> List<&2, Nat>:
11  match bs:
12    case Nil{}: Nil{}
13    case b0 <> Nil{}: [byte(b0)]
14    case b0 <> b1 <> t: Nat.add(Nat.mul(byte(b1), 256n), byte(b0)) <> limbs_le(t)

Uses (6)

Used by (1)