From e865fa9e447ddb1583045b03f893597645176350 Mon Sep 17 00:00:00 2001 From: Aaron Feickert <66188213+AaronFeickert@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:35:21 -0500 Subject: [PATCH] Range proof transcript API update --- src/ristretto/bulletproofs_plus.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ristretto/bulletproofs_plus.rs b/src/ristretto/bulletproofs_plus.rs index 48e6f96b..5c5d71e5 100644 --- a/src/ristretto/bulletproofs_plus.rs +++ b/src/ristretto/bulletproofs_plus.rs @@ -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, @@ -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, @@ -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, @@ -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, ) { @@ -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,