addressed comments

This commit is contained in:
Nicholas Ward 2021-11-01 15:22:21 -07:00
parent bd0164c7ef
commit 237a1fad1d
2 changed files with 6 additions and 1 deletions

View File

@ -155,7 +155,10 @@ mod tests {
fn test_nonnative_sub() -> Result<()> {
type FF = Secp256K1Base;
let x_ff = FF::rand();
let y_ff = FF::rand();
let mut y_ff = FF::rand();
while y_ff.to_biguint() > x_ff.to_biguint() {
y_ff = FF::rand();
}
let diff_ff = x_ff - y_ff;
type F = CrandallField;

View File

@ -160,6 +160,8 @@ impl<F: Field> GeneratedValues<F> {
pub fn set_biguint_target(&mut self, target: BigUintTarget, value: BigUint) {
let mut limbs = value.to_u32_digits();
assert!(target.num_limbs() >= limbs.len());
limbs.resize(target.num_limbs(), 0);
for i in 0..target.num_limbs() {
self.set_u32_target(target.get_limb(i), limbs[i]);