diff --git a/r1cs-std/src/bits/boolean.rs b/r1cs-std/src/bits/boolean.rs index 70759d1..ed48a22 100644 --- a/r1cs-std/src/bits/boolean.rs +++ b/r1cs-std/src/bits/boolean.rs @@ -1985,35 +1985,6 @@ mod test { assert!(cs.is_satisfied()); } - - // for _ in 0..1000 { - // // Sample a random element not in the field - // let r = loop { - // let mut a = Fr::rand(&mut rng).into_repr(); - // let b = Fr::rand(&mut rng).into_repr(); - - // a.add_nocarry(&b); - // // we're shaving off the high bit_gadget later - // a.as_mut()[3] &= 0x7fffffffffffffff; - // if Fr::from_repr(a).is_err() { - // break a; - // } - // }; - - // let mut cs = TestConstraintSystem::::new(); - - // let mut bits = vec![]; - // for (i, b) in BitIterator::new(r).skip(1).enumerate() { - // bits.push(Boolean::from( - // AllocatedBit::alloc(cs.ns(|| format!("bit_gadget {}", - // i)), Some(b)) .unwrap(), - // )); - // } - - // Boolean::enforce_in_field::<_, _, Fr>(&mut cs, &bits).unwrap(); - - // assert!(!cs.is_satisfied()); - // } } #[test] diff --git a/r1cs-std/src/fields/fp/cmp.rs b/r1cs-std/src/fields/fp/cmp.rs index ca0cbcc..662d1f1 100644 --- a/r1cs-std/src/fields/fp/cmp.rs +++ b/r1cs-std/src/fields/fp/cmp.rs @@ -222,7 +222,7 @@ mod test { 0x06, 0x54, ]); fn rand_in_range(rng: &mut R) -> Fr { - let pminusonedivtwo = Fr::from_repr(Fr::modulus_minus_one_div_two()); + let pminusonedivtwo: Fr = Fr::modulus_minus_one_div_two().into(); let mut r; loop { r = Fr::rand(rng);