diff --git a/src/gadgets/biguint.rs b/src/gadgets/biguint.rs index 83ca5796..1f4ccbb5 100644 --- a/src/gadgets/biguint.rs +++ b/src/gadgets/biguint.rs @@ -26,7 +26,7 @@ impl BigUintTarget { } impl, const D: usize> CircuitBuilder { - fn constant_biguint(&mut self, value: BigUint) -> BigUintTarget { + fn constant_biguint(&mut self, value: &BigUint) -> BigUintTarget { let limb_values = value.to_u32_digits(); let mut limbs = Vec::new(); for i in 0..limb_values.len() { @@ -194,6 +194,24 @@ impl, const D: usize> CircuitBuilder { (div, rem) } + + pub fn div_biguint( + &mut self, + a: BigUintTarget, + b: BigUintTarget, + ) -> BigUintTarget { + let (div, _rem) = self.div_rem_biguint(a, b); + div + } + + pub fn rem_biguint( + &mut self, + a: BigUintTarget, + b: BigUintTarget, + ) -> BigUintTarget { + let (_div, rem) = self.div_rem_biguint(a, b); + rem + } } #[derive(Debug)]