def borrow
import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as Limbsimport Base
180# 1 when the value of xs is below the value of ys plus br, else 0 (the
181# borrow out of xs - ys - br), for lists of the same length
182def borrow(xs: List<&2, Nat>, ys: List<&2, Nat>, br: Nat) -> Nat:
183 match xs ys:
184 case x <> xt y <> yt: borrow(xt, yt, b2n(Nat.is_lt(x, Nat.add(br, y))))
185 case _ _: br