pub fn verify_multiple_with_rng<T: RngCore + CryptoRng>(
        &self,
        bp_gens: &BulletproofGens,
        pc_gens: &PedersenGens,
        transcript: &mut Transcript,
        value_commitments: &[CompressedRistretto],
        n: usize,
        rng: &mut T,
    ) -> Result<(), ProofError> {
        let m = value_commitments.len();

        let scalars = self.compute_verification_scalars_with_rng(
            bp_gens,
            transcript,
            value_commitments,
            n,
            rng,
        )?;

        let mega_check = RistrettoPoint::optional_multiscalar_mul(
            scalars,
            iter::once(self.A.decompress())
                .chain(iter::once(self.S.decompress()))
                .chain(iter::once(self.T_1.decompress()))
                .chain(iter::once(self.T_2.decompress()))
                .chain(self.ipp_proof.L_vec.iter().map(|L| L.decompress()))
                .chain(self.ipp_proof.R_vec.iter().map(|R| R.decompress()))
                .chain(value_commitments.iter().map(|V| V.decompress()))
                .chain(iter::once(Some(pc_gens.B_blinding)))
                .chain(iter::once(Some(pc_gens.B)))
                .chain(bp_gens.G(n, m).map(|&x| Some(x)))
                .chain(bp_gens.H(n, m).map(|&x| Some(x))),
        )
        .ok_or_else(|| ProofError::VerificationError)?;

        if mega_check.is_identity() {
            Ok(())
        } else {
            Err(ProofError::VerificationError)
        }
    }
/// Verifies an aggregated rangeproof for the given value commitments.
Verifies an aggregated rangeproof for the given value commitments.
Verifies an aggregated rangeproof for the given value commitments .
pub fn verify_multiple_with_rng<T: RngCore + CryptoRng>(
        &self,
        bp_gens: &BulletproofGens,
        pc_gens: &PedersenGens,
        transcript: &mut Transcript,
        value_commitments: &[CompressedRistretto],
        n: usize,
        rng: &mut T,
    ) -> Result<(), ProofError> {
        let m = value_commitments.len();
        let scalars = self.compute_verification_scalars_with_rng(
            bp_gens,
            transcript,
            value_commitments,
            n,
            rng,
        )?;
        let mega_check = RistrettoPoint::optional_multiscalar_mul(
            scalars,
            iter::once(self.A.decompress())
                .chain(iter::once(self.S.decompress()))
                .chain(iter::once(self.T_1.decompress()))
                .chain(iter::once(self.T_2.decompress()))
                .chain(self.ipp_proof.L_vec.iter().map(|L| L.decompress()))
                .chain(self.ipp_proof.R_vec.iter().map(|R| R.decompress()))
                .chain(value_commitments.iter().map(|V| V.decompress()))
                .chain(iter::once(Some(pc_gens.B_blinding)))
                .chain(iter::once(Some(pc_gens.B)))
                .chain(bp_gens.G(n, m).map(|&x| Some(x)))
                .chain(bp_gens.H(n, m).map(|&x| Some(x))),
        )
        .ok_or_else(|| ProofError::VerificationError)?;
        if mega_check.is_identity() {
            Ok(())
        } else {
            Err(ProofError::VerificationError)
        }
    }
pub fn verify_multiple_with_rng < T : RngCore + CryptoRng > ( & self , bp_gens : & BulletproofGens , pc_gens : & PedersenGens , transcript : & mut Transcript , value_commitments : & [ CompressedRistretto ] , n : usize , rng : & mut T , ) -> Result < ( ) , ProofError > { let m = value_commitments . len ( ) ; let scalars = self . compute_verification_scalars_with_rng ( bp_gens , transcript , value_commitments , n , rng , ) ? ; let mega_check = RistrettoPoint :: optional_multiscalar_mul ( scalars , iter :: once ( self . A . decompress ( ) ) . chain ( iter :: once ( self . S . decompress ( ) ) ) . chain ( iter :: once ( self . T_1 . decompress ( ) ) ) . chain ( iter :: once ( self . T_2 . decompress ( ) ) ) . chain ( self . ipp_proof . L_vec . iter ( ) . map ( | L | L . decompress ( ) ) ) . chain ( self . ipp_proof . R_vec . iter ( ) . map ( | R | R . decompress ( ) ) ) . chain ( value_commitments . iter ( ) . map ( | V | V . decompress ( ) ) ) . chain ( iter :: once ( Some ( pc_gens . B_blinding ) ) ) . chain ( iter :: once ( Some ( pc_gens . B ) ) ) . chain ( bp_gens . G ( n , m ) . map ( | & x | Some ( x ) ) ) . chain ( bp_gens . H ( n , m ) . map ( | & x | Some ( x ) ) ) , ) . ok_or_else ( | | ProofError :: VerificationError ) ? ; if mega_check . is_identity ( ) { Ok ( ( ) ) } else { Err ( ProofError :: VerificationError ) } }
Verifies an aggregated rangeproof for the given value commitments.
Verifies an aggregated rangeproof for the given value commitments .
&self
bp_gens
&BulletproofGens
pc_gens
&PedersenGens
transcript
&mut Transcript
value_commitments
&[CompressedRistretto]
n
usize
rng
&mut T
&self
bp_gens
&BulletproofGens
pc_gens
&PedersenGens
transcript
&mut Transcript
value_commitments
&[CompressedRistretto]
n
usize
rng
&mut T