mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-11 02:03:07 +00:00
reduce
This commit is contained in:
parent
6232aa68fb
commit
87d8129034
@ -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)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user