def bits_of

bend-collections@1.0.0.0 · src/crypto/secp256k1/limbs.bend:207

import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as Limbs
import Base

207# the k low bits of x, most significant first
208def bits_of(k: Nat, +x: Nat) -> List<&2, Nat>:
209  match k:
210    case 0n: Nil{}
211    case 1n+j: List.append(&2, Nat, bits_of(j, Nat.div(x, 2n)), [Nat.mod(x, 2n)])

Uses (5)

Used by (1)