pub fn prove_multiple_with_rng<T: RngCore + CryptoRng>(
        bp_gens: &BulletproofGens,
        pc_gens: &PedersenGens,
        values: &[u64],
        blindings: &[Scalar],
        n: usize,
        rng: &mut T,
    ) -> Result<(RangeProof, Vec<EdwardsPoint>), ProofError> {
        use self::dealer::*;
        use self::party::*;

        if values.len() != blindings.len() {
            return Err(ProofError::WrongNumBlindingFactors);
        }

        let dealer = Dealer::create(bp_gens, pc_gens, n, values.len())?;

        let parties: Vec<_> = values
            .iter()
            .zip(blindings.iter())
            .map(|(&v, &v_blinding)| Party::create(bp_gens, pc_gens, v, v_blinding, n))
            .collect::<Result<Vec<_>, _>>()?;

        let (parties, bit_commitments): (Vec<_>, Vec<_>) = parties
            .into_iter()
            .enumerate()
            .map(|(j, p)| {
                p.assign_position_with_rng(j, rng)
                    .expect("We already checked the parameters, so this should never happen")
            })
            .unzip();

        let value_commitments: Vec<_> = bit_commitments.iter().map(|c| c.V_j).collect();

        let (dealer, bit_challenge) = dealer.receive_bit_commitments(bit_commitments)?;

        let (parties, poly_commitments): (Vec<_>, Vec<_>) = parties
            .into_iter()
            .map(|p| p.apply_challenge_with_rng(&bit_challenge, rng))
            .unzip();

        let (dealer, poly_challenge) = dealer.receive_poly_commitments(poly_commitments)?;

        let proof_shares: Vec<_> = parties
            .into_iter()
            .map(|p| p.apply_challenge(&poly_challenge))
            .collect::<Result<Vec<_>, _>>()?;

        let proof = dealer.receive_trusted_shares(&proof_shares)?;

        Ok((proof, value_commitments))
    }
/// Create a rangeproof for a set of values.
Create a rangeproof for a set of values.
Create a rangeproof for a set of values .
pub fn prove_multiple_with_rng<T: RngCore + CryptoRng>(
        bp_gens: &BulletproofGens,
        pc_gens: &PedersenGens,
        values: &[u64],
        blindings: &[Scalar],
        n: usize,
        rng: &mut T,
    ) -> Result<(RangeProof, Vec<EdwardsPoint>), ProofError> {
        use self::dealer::*;
        use self::party::*;
        if values.len() != blindings.len() {
            return Err(ProofError::WrongNumBlindingFactors);
        }
        let dealer = Dealer::create(bp_gens, pc_gens, n, values.len())?;
        let parties: Vec<_> = values
            .iter()
            .zip(blindings.iter())
            .map(|(&v, &v_blinding)| Party::create(bp_gens, pc_gens, v, v_blinding, n))
            .collect::<Result<Vec<_>, _>>()?;
        let (parties, bit_commitments): (Vec<_>, Vec<_>) = parties
            .into_iter()
            .enumerate()
            .map(|(j, p)| {
                p.assign_position_with_rng(j, rng)
                    .expect("We already checked the parameters, so this should never happen")
            })
            .unzip();
        let value_commitments: Vec<_> = bit_commitments.iter().map(|c| c.V_j).collect();
        let (dealer, bit_challenge) = dealer.receive_bit_commitments(bit_commitments)?;
        let (parties, poly_commitments): (Vec<_>, Vec<_>) = parties
            .into_iter()
            .map(|p| p.apply_challenge_with_rng(&bit_challenge, rng))
            .unzip();
        let (dealer, poly_challenge) = dealer.receive_poly_commitments(poly_commitments)?;
        let proof_shares: Vec<_> = parties
            .into_iter()
            .map(|p| p.apply_challenge(&poly_challenge))
            .collect::<Result<Vec<_>, _>>()?;
        let proof = dealer.receive_trusted_shares(&proof_shares)?;
        Ok((proof, value_commitments))
    }
pub fn prove_multiple_with_rng < T : RngCore + CryptoRng > ( bp_gens : & BulletproofGens , pc_gens : & PedersenGens , values : & [ u64 ] , blindings : & [ Scalar ] , n : usize , rng : & mut T , ) -> Result < ( RangeProof , Vec < EdwardsPoint > ) , ProofError > { use self :: dealer :: * ; use self :: party :: * ; if values . len ( ) != blindings . len ( ) { return Err ( ProofError :: WrongNumBlindingFactors ) ; } let dealer = Dealer :: create ( bp_gens , pc_gens , n , values . len ( ) ) ? ; let parties : Vec < _ > = values . iter ( ) . zip ( blindings . iter ( ) ) . map ( | ( & v , & v_blinding ) | Party :: create ( bp_gens , pc_gens , v , v_blinding , n ) ) . collect :: < Result < Vec < _ > , _ > > ( ) ? ; let ( parties , bit_commitments ) : ( Vec < _ > , Vec < _ > ) = parties . into_iter ( ) . enumerate ( ) . map ( | ( j , p ) | { p . assign_position_with_rng ( j , rng ) . expect ( " " ) } ) . unzip ( ) ; let value_commitments : Vec < _ > = bit_commitments . iter ( ) . map ( | c | c . V_j ) . collect ( ) ; let ( dealer , bit_challenge ) = dealer . receive_bit_commitments ( bit_commitments ) ? ; let ( parties , poly_commitments ) : ( Vec < _ > , Vec < _ > ) = parties . into_iter ( ) . map ( | p | p . apply_challenge_with_rng ( & bit_challenge , rng ) ) . unzip ( ) ; let ( dealer , poly_challenge ) = dealer . receive_poly_commitments ( poly_commitments ) ? ; let proof_shares : Vec < _ > = parties . into_iter ( ) . map ( | p | p . apply_challenge ( & poly_challenge ) ) . collect :: < Result < Vec < _ > , _ > > ( ) ? ; let proof = dealer . receive_trusted_shares ( & proof_shares ) ? ; Ok ( ( proof , value_commitments ) ) }
Create a rangeproof for a set of values.
Create a rangeproof for a set of values .
bp_gens
&BulletproofGens
pc_gens
&PedersenGens
values
&[u64]
blindings
&[Scalar]
n
usize
rng
&mut T
bp_gens
&BulletproofGens
pc_gens
&PedersenGens
values
&[u64]
blindings
&[Scalar]
n
usize
rng
&mut T