/// Compute in-circuit COMM^cred and add this to the circuit.
/// Return the unique `Num` that represents the hash.
Compute in-circuit COMM^cred and add this to the circuit.
Return the unique `Num` that represents the hash.
Compute in - circuit COMM^cred and add this to the circuit . Return the unique ` Num ` that represents the hash .
pub fn comm_cred<CS: ConstraintSystem<bls12_381::Scalar>>(
    cs: CS,
    s_cred: &[Boolean],
    pk_addr: &[Boolean],
    sk_addr: &[Boolean],
) -> Result<AllocatedNum<bls12_381::Scalar>, SynthesisError> {
    assert_eq!(s_cred.len(), 252);
    assert_eq!(pk_addr.len(), 256);
    assert_eq!(sk_addr.len(), 256);
    let mut preimage = vec![];
    preimage.extend(pk_addr.iter().cloned());
    preimage.extend(sk_addr.iter().cloned());
    comm(
        cs,
        s_cred,
        &preimage,
        Personalisation::CredCommitment,
        &*CRED_COMMITMENT_RANDOMNESS_GENERATOR,
    )
}
pub fn comm_cred < CS : ConstraintSystem < bls12_381 :: Scalar > > ( cs : CS , s_cred : & [ Boolean ] , pk_addr : & [ Boolean ] , sk_addr : & [ Boolean ] , ) -> Result < AllocatedNum < bls12_381 :: Scalar > , SynthesisError > { assert_eq ! ( s_cred len ( ) 252 ) ; assert_eq ! ( pk_addr len ( ) 256 ) ; assert_eq ! ( sk_addr len ( ) 256 ) ; let mut preimage = vec ! [ ] ; preimage . extend ( pk_addr . iter ( ) . cloned ( ) ) ; preimage . extend ( sk_addr . iter ( ) . cloned ( ) ) ; comm ( cs , s_cred , & preimage , Personalisation :: CredCommitment , & * CRED_COMMITMENT_RANDOMNESS_GENERATOR , ) }
Compute in-circuit COMM^cred and add this to the circuit.
Compute in - circuit COMM^cred and add this to the circuit .
cs
CS
s_cred
&[Boolean]
pk_addr
&[Boolean]
sk_addr
&[Boolean]