Skip to content

Commit

Permalink
WIP: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Sep 7, 2023
1 parent 19123af commit a827c28
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions src/ristretto/bulletproofs_plus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -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() {
Expand Down Expand Up @@ -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();

Expand All @@ -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
Expand Down

0 comments on commit a827c28

Please sign in to comment.