Field.sub: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/secp256k1/field.bend as Field Lines 48-53 of bend-collections@1.0.0.0/src/crypto/secp256k1/field.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/field.bend&start_line=48&end_line=53 import Base import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as L # a - b = a + (p - b); the first argument is looked at first, so that a # constant b is never unfolded while a is unknown def sub(a: List<&2, Nat>, +b: List<&2, Nat>) -> List<&2, Nat>: match a: case Nil{}: reduce(L.neg_raw(c(), b)) case x <> t: reduce(L.add(x <> t, L.neg_raw(c(), b))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/field.bend&name=c https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/field.bend&name=reduce https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=add https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=neg_raw