def sub
import bend-collections@1.0.0.0/src/crypto/secp256k1/field.bend as Fieldimport Base
import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as L
48# a - b = a + (p - b); the first argument is looked at first, so that a
49# constant b is never unfolded while a is unknown
50def sub(a: List<&2, Nat>, +b: List<&2, Nat>) -> List<&2, Nat>:
51 match a:
52 case Nil{}: reduce(L.neg_raw(c(), b))
53 case x <> t: reduce(L.add(x <> t, L.neg_raw(c(), b)))