pub fn sub(builder: &CircuitBuilder, a: &BigUint, b: &BigUint) -> BigUintExpand description
Subtracts two equally-sized BigUintss with carry propagation.
Computes a - b with proper borrow handling between limbs. The result
has the same number of limbs as the inputs. Underflow beyond the most
significant limb is checked and must be zero. This implies that a >= b
and the difference remains unsigned.
§Arguments
builder- Circuit builder for constraint generationa- minuendb- subtrahend (must have same number of limbs asa)
§Returns
Difference as a BigUint with the same number of limbs as the inputs
§Panics
- Panics if
aandbhave different number of limbs