Skip to content

Commit

Permalink
Range proof transcript API update
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Oct 24, 2023
1 parent f580ab1 commit e865fa9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/ristretto/bulletproofs_plus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl RangeProofService for BulletproofsPlusService {
seed_nonce: None,
};
match RistrettoRangeProof::verify_batch(
self.transcript_label,
&[self.transcript_label],
&[statement],
&[rp.clone()],
VerifyAction::VerifyOnly,
Expand Down Expand Up @@ -362,10 +362,13 @@ impl ExtendedRangeProofService for BulletproofsPlusService {
// Deserialize the range proofs
let range_proofs = self.deserialize_range_proofs(&proofs)?;

// Set up a common transcript label
let transcript_labels = vec![self.transcript_label; range_statements.len()];

// Verify and recover
let mut recovered_extended_masks = Vec::new();
match RistrettoRangeProof::verify_batch(
self.transcript_label,
&transcript_labels,
&range_statements,
&range_proofs,
VerifyAction::RecoverAndVerify,
Expand Down Expand Up @@ -406,9 +409,12 @@ impl ExtendedRangeProofService for BulletproofsPlusService {
// Deserialize the range proofs
let range_proofs = self.deserialize_range_proofs(&proofs)?;

// Set up a common transcript label
let transcript_labels = vec![self.transcript_label; range_statements.len()];

// Verify
match RistrettoRangeProof::verify_batch(
self.transcript_label,
&transcript_labels,
&range_statements,
&range_proofs,
VerifyAction::VerifyOnly,
Expand Down Expand Up @@ -440,8 +446,8 @@ impl ExtendedRangeProofService for BulletproofsPlusService {
// Prepare the range statement

match RistrettoRangeProof::verify_batch(
self.transcript_label,
&vec![statement],
&[self.transcript_label],
&[statement],
&[rp],
VerifyAction::RecoverOnly,
) {
Expand Down Expand Up @@ -485,7 +491,7 @@ impl ExtendedRangeProofService for BulletproofsPlusService {
let range_statements = self.prepare_private_range_statements(vec![statement]);

match RistrettoRangeProof::verify_batch(
self.transcript_label,
&[self.transcript_label],
&range_statements,
&[rp],
VerifyAction::RecoverOnly,
Expand Down

0 comments on commit e865fa9

Please sign in to comment.