def cbits

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

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

213# every bit flipped: the bits of 2^k - 1 - x from those of x
214def cbits(bs: List<&2, Nat>) -> List<&2, Nat>:
215  match bs:
216    case Nil{}: Nil{}
217    case b <> t: Nat.sub(1n, b) <> cbits(t)

Uses (3)

Used by (13)