fn cm_commit(
        comm_key: &[G],
        scalars: &[G::ScalarField],
        hiding_generator: Option<G>,
        randomizer: Option<G::ScalarField>,
    ) -> G::Projective {
        let scalars_bigint = ark_std::cfg_iter!(scalars)
            .map(|s| s.into_bigint())
            .collect::<Vec<_>>();

        let mut comm = VariableBase::msm(comm_key, &scalars_bigint);

        if randomizer.is_some() {
            assert!(hiding_generator.is_some());
            comm += &hiding_generator.unwrap().mul(randomizer.unwrap());
        }

        comm
    }
/// Create a Pedersen commitment to `scalars` using the commitment key `comm_key`.
/// Optionally, randomize the commitment using `hiding_generator` and `randomizer`.
Create a Pedersen commitment to `scalars` using the commitment key `comm_key`.
Optionally, randomize the commitment using `hiding_generator` and `randomizer`.
Create a Pedersen commitment to ` scalars ` using the commitment key ` comm_key ` . Optionally randomize the commitment using ` hiding_generator ` and ` randomizer ` .
fn cm_commit(
        comm_key: &[G],
        scalars: &[G::ScalarField],
        hiding_generator: Option<G>,
        randomizer: Option<G::ScalarField>,
    ) -> G::Projective {
        let scalars_bigint = ark_std::cfg_iter!(scalars)
            .map(|s| s.into_bigint())
            .collect::<Vec<_>>();
        let mut comm = VariableBase::msm(comm_key, &scalars_bigint);
        if randomizer.is_some() {
            assert!(hiding_generator.is_some());
            comm += &hiding_generator.unwrap().mul(randomizer.unwrap());
        }
        comm
    }
fn cm_commit ( comm_key : & [ G ] , scalars : & [ G :: ScalarField ] , hiding_generator : Option < G > , randomizer : Option < G :: ScalarField > , ) -> G :: Projective { let scalars_bigint = ark_std :: cfg_iter ! ( scalars ) . map ( | s | s . into_bigint ( ) ) . collect :: < Vec < _ > > ( ) ; let mut comm = VariableBase :: msm ( comm_key , & scalars_bigint ) ; if randomizer . is_some ( ) { assert ! ( hiding_generator is_some ( ) ) ; comm += & hiding_generator . unwrap ( ) . mul ( randomizer . unwrap ( ) ) ; } comm }
Create a Pedersen commitment to `scalars` using the commitment key `comm_key`.
Create a Pedersen commitment to ` scalars ` using the commitment key ` comm_key ` .
comm_key
&[G]
scalars
&[G::ScalarField]
hiding_generator
Option<G>
randomizer
Option<G::ScalarField>