diff --git a/src/verifier.rs b/src/verifier.rs index ac247a7..287798d 100644 --- a/src/verifier.rs +++ b/src/verifier.rs @@ -53,8 +53,7 @@ impl Verifier { inputs[0] = 1; sum += new_equation.evaluate_over_f(inputs.to_vec(), self.f); sum = sum % self.f; - inputs[0] = value; - if sum != previous_equation.evaluate_over_f(inputs.try_into().unwrap(), self.f) { + if sum != previous_equation.evaluate_over_f([value].try_into().unwrap(), self.f) { println!("sum: {}", sum); println!( "previous: {}", @@ -76,10 +75,4 @@ impl Verifier { panic!("sum is not equal to the sum of the equation"); } } - pub fn choose_random_input_and_set_value(&self, lenght: usize) -> (i128, i128) { - let mut rng = rand::thread_rng(); - let random_index = rng.gen_range(0..lenght); - let random_value = rng.gen_range(0..self.f); - (random_index as i128, random_value) - } } diff --git a/tests/proving_process_test.rs b/tests/proving_process_test.rs index d20e5a6..86d3e14 100644 --- a/tests/proving_process_test.rs +++ b/tests/proving_process_test.rs @@ -11,3 +11,9 @@ fn test_verify_process2() { let equation = sum_check::equation::Equation::from_string("x1+x2+x3"); sum_check::proving_process_interactive::run_proving_process(equation, 100); } + +#[test] +fn test_verify_process3() { + let equation = sum_check::equation::Equation::from_string("2*x1^3+x1*x2+x2*x3"); + sum_check::proving_process_interactive::run_proving_process(equation, 1000); +}