This commit is contained in:
Nicholas Ward 2021-10-26 14:38:10 -07:00
parent 6232aa68fb
commit 87d8129034

View File

@ -26,7 +26,7 @@ impl BigUintTarget {
}
impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
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<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
(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)]