fn comm<CS: ConstraintSystem<bls12_381::Scalar>>(
    mut cs: CS,
    randomness: &[Boolean],
    preimage: &[Boolean],
    personalisation: Personalisation,
    fixed_generator: FixedGenerator,
) -> Result<AllocatedNum<bls12_381::Scalar>, SynthesisError> {
    let hash = pedersen_hash(cs.namespace(|| "hash"), personalisation, preimage)?;
    let randomness =
        fixed_base_multiplication(cs.namespace(|| "randomness"), fixed_generator, randomness)?;

    Ok(hash
        .add(cs.namespace(|| "add hash and randomness"), &randomness)?
        .get_u()
        .clone())
}
/// Compute in-circuit commitment of the `preimage` using `randomness` and add this to the circuit.
/// Return the unique `Num` that represents the hash.
Compute in-circuit commitment of the `preimage` using `randomness` and add this to the circuit.
Return the unique `Num` that represents the hash.
Compute in - circuit commitment of the ` preimage ` using ` randomness ` and add this to the circuit . Return the unique ` Num ` that represents the hash .
fn comm<CS: ConstraintSystem<bls12_381::Scalar>>(
    mut cs: CS,
    randomness: &[Boolean],
    preimage: &[Boolean],
    personalisation: Personalisation,
    fixed_generator: FixedGenerator,
) -> Result<AllocatedNum<bls12_381::Scalar>, SynthesisError> {
    let hash = pedersen_hash(cs.namespace(|| "hash"), personalisation, preimage)?;
    let randomness =
        fixed_base_multiplication(cs.namespace(|| "randomness"), fixed_generator, randomness)?;
    Ok(hash
        .add(cs.namespace(|| "add hash and randomness"), &randomness)?
        .get_u()
        .clone())
}
fn comm < CS : ConstraintSystem < bls12_381 :: Scalar > > ( mut cs : CS , randomness : & [ Boolean ] , preimage : & [ Boolean ] , personalisation : Personalisation , fixed_generator : FixedGenerator , ) -> Result < AllocatedNum < bls12_381 :: Scalar > , SynthesisError > { let hash = pedersen_hash ( cs . namespace ( | | " " ) , personalisation , preimage ) ? ; let randomness = fixed_base_multiplication ( cs . namespace ( | | " " ) , fixed_generator , randomness ) ? ; Ok ( hash . add ( cs . namespace ( | | " " ) , & randomness ) ? . get_u ( ) . clone ( ) ) }
Compute in-circuit commitment of the `preimage` using `randomness` and add this to the circuit.
Compute in - circuit commitment of the ` preimage ` using ` randomness ` and add this to the circuit .
cs
CS
randomness
&[Boolean]
preimage
&[Boolean]
personalisation
Personalisation
fixed_generator
FixedGenerator
cs
CS
randomness
&[Boolean]
preimage
&[Boolean]
personalisation
Personalisation
fixed_generator
FixedGenerator