def cbits
import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as Limbsimport 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)