Skip to content

Commit

Permalink
test: lower number of test cases for some FRI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Oct 6, 2023
1 parent 70f3d95 commit 0159a68
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions triton-vm/src/fri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ mod tests {
}

proptest! {
#![proptest_config(ProptestConfig::with_cases(50))]
#[test]
fn prove_and_verify_low_degree_of_twice_cubing_plus_one(
fri in arbitrary_fri_supporting_degree(3)
Expand All @@ -798,6 +799,7 @@ mod tests {
}

proptest! {
#![proptest_config(ProptestConfig::with_cases(50))]
#[test]
fn prove_and_verify_low_degree_polynomial(
(fri, polynomial) in arbitrary_matching_fri_and_polynomial_pair(),
Expand All @@ -814,6 +816,7 @@ mod tests {
}

proptest! {
#![proptest_config(ProptestConfig::with_cases(50))]
#[test]
fn prove_and_fail_to_verify_high_degree_polynomial(
(fri, polynomial) in arbitrary_non_matching_fri_and_polynomial_pair(),
Expand Down Expand Up @@ -896,14 +899,15 @@ mod tests {
// todo: add test fuzzing proof_stream

proptest! {
#![proptest_config(ProptestConfig::with_cases(50))]
#[test]
fn serialization(fri in arbitrary_fri_supporting_degree(3)) {
let coefficients = [1, 0, 0, 2].map(|c| c.into()).to_vec();
let polynomial = Polynomial::new(coefficients);
fn serialization(
(fri, polynomial) in arbitrary_matching_fri_and_polynomial_pair(),
) {
let codeword = fri.domain.evaluate(&polynomial);

let mut prover_proof_stream = ProofStream::new();
fri.prove(&codeword, &mut prover_proof_stream);

let proof = (&prover_proof_stream).into();
let verifier_proof_stream = ProofStream::<Tip5>::try_from(&proof).unwrap();

Expand All @@ -923,6 +927,7 @@ mod tests {
}

proptest! {
#![proptest_config(ProptestConfig::with_cases(50))]
#[test]
fn last_round_codeword_unequal_to_last_round_commitment_results_in_validation_failure(
fri in arbitrary_fri(),
Expand Down Expand Up @@ -977,6 +982,7 @@ mod tests {
}

proptest! {
#![proptest_config(ProptestConfig::with_cases(50))]
#[test]
fn revealing_wrong_number_of_leaves_results_in_validation_failure(
fri in arbitrary_fri(),
Expand All @@ -989,7 +995,7 @@ mod tests {

let proof_stream = prepare_proof_stream_for_verification(proof_stream);
let mut proof_stream =
modify_some_fri_response_in_proof_stream_using_seed(proof_stream, rng_seed);
change_size_of_some_fri_response_in_proof_stream_using_seed(proof_stream, rng_seed);

let verdict = fri.verify(&mut proof_stream, &mut None);
let err = verdict.unwrap_err();
Expand All @@ -999,7 +1005,7 @@ mod tests {
}

#[must_use]
fn modify_some_fri_response_in_proof_stream_using_seed<H: AlgebraicHasher>(
fn change_size_of_some_fri_response_in_proof_stream_using_seed<H: AlgebraicHasher>(
mut proof_stream: ProofStream<H>,
seed: u64,
) -> ProofStream<H> {
Expand All @@ -1026,6 +1032,7 @@ mod tests {
}

proptest! {
#![proptest_config(ProptestConfig::with_cases(50))]
#[test]
fn incorrect_authentication_structure_results_in_validation_failure(
fri in arbitrary_fri(),
Expand Down

0 comments on commit 0159a68

Please sign in to comment.