From a827c2864e3ef9b976157a62cf91218bc3cc155a Mon Sep 17 00:00:00 2001 From: Aaron Feickert <66188213+AaronFeickert@users.noreply.github.com> Date: Thu, 7 Sep 2023 15:52:36 -0500 Subject: [PATCH] WIP: formatting --- src/ristretto/bulletproofs_plus.rs | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/ristretto/bulletproofs_plus.rs b/src/ristretto/bulletproofs_plus.rs index 85a50257..fe302ff1 100644 --- a/src/ristretto/bulletproofs_plus.rs +++ b/src/ristretto/bulletproofs_plus.rs @@ -634,14 +634,13 @@ mod test { let proof = proof.unwrap(); // Successful verification - assert!( - bulletproofs_plus_service.verify(&proof, &factory.commit_value(&key, value)) - ); + assert!(bulletproofs_plus_service.verify(&proof, &factory.commit_value(&key, value))); // Failed verification (due to a bad mask) - assert!( - !bulletproofs_plus_service.verify(&proof, &factory.commit_value(&RistrettoSecretKey(Scalar::random_not_zero(&mut rng)), value)) - ); + assert!(!bulletproofs_plus_service.verify( + &proof, + &factory.commit_value(&RistrettoSecretKey(Scalar::random_not_zero(&mut rng)), value) + )); } else { assert!(proof.is_err()); } @@ -650,17 +649,6 @@ mod test { } } - /// Test extended range proof service functionality without mask recovery - /// These proofs are not aggregated, but may use extension and batch verification - #[test] - fn test_extended_range_proof_service_no_recovery() { - let mut rng = rand::thread_rng(); - const BIT_LENGTH: usize = 4; - const BATCH_SIZE: usize = 2; - const EXTENSION_DEGREES: [CommitmentExtensionDegree; 2] = [CommitmentExtensionDegree::DefaultPedersen, CommitmentExtensionDegree::AddFiveBasePoints]; - - } - #[test] #[allow(clippy::too_many_lines)] fn test_construct_verify_extended_proof_with_recovery() { @@ -830,8 +818,7 @@ mod test { for _ in 0..AGGREGATION_FACTOR { let value = rng.gen_range(value_min..value_max); let minimum_value_promise = value / 3; - let secrets = - vec![RistrettoSecretKey(Scalar::random_not_zero(&mut rng)); extension_degree as usize]; + let secrets = vec![RistrettoSecretKey(Scalar::random_not_zero(&mut rng)); extension_degree as usize]; let extended_mask = RistrettoExtendedMask::assign(extension_degree, secrets.clone()).unwrap(); let commitment = factory.commit_value_extended(&secrets, value).unwrap(); @@ -850,7 +837,9 @@ mod test { let aggregated_statement = RistrettoAggregatedPublicStatement::init(statements).unwrap(); // Generate an aggregate proof - let proof = bulletproofs_plus_service.construct_extended_proof(extended_witnesses, None).unwrap(); + let proof = bulletproofs_plus_service + .construct_extended_proof(extended_witnesses, None) + .unwrap(); // Verify the proof assert!(bulletproofs_plus_service