What if we didn't make a new circuit for every iteration in the test
This commit is contained in:
+4
-3
@@ -6,6 +6,8 @@ mod tests {
|
||||
use rand::rngs::OsRng;
|
||||
#[test]
|
||||
fn test_scalar_comparison_via_circuit() {
|
||||
let circuit = Circuit::compare_n_bit_numbers(256);
|
||||
|
||||
for _ in 0..100 {
|
||||
let a = Scalar::random(&mut OsRng);
|
||||
let b = Scalar::random(&mut OsRng);
|
||||
@@ -19,9 +21,8 @@ mod tests {
|
||||
input_bits.extend_from_slice(&a_bits);
|
||||
input_bits.extend_from_slice(&b_bits);
|
||||
|
||||
// Build and evaluate the comparison circuit
|
||||
let circuit = Circuit::compare_n_bit_numbers(input_bits, 256);
|
||||
let circuit_result = circuit.eval();
|
||||
// Evaluate the comparison circuit
|
||||
let circuit_result = circuit.clone().eval(input_bits);
|
||||
|
||||
// Compare expected result using BigUint
|
||||
let a_int = BigUint::from_bytes_le(&a.to_bytes());
|
||||
|
||||
Reference in New Issue
Block a user