pub fn comm_mem<CS: ConstraintSystem<bls12_381::Scalar>>(
    cs: CS,
    s_mem: &[Boolean],
    pk_addr: &[Boolean],
    v_mem: &[Boolean],
    c_mem: &[Boolean],
) -> Result<AllocatedNum<bls12_381::Scalar>, SynthesisError> {
    assert_eq!(s_mem.len(), 252);
    assert_eq!(pk_addr.len(), 256);
    assert_eq!(v_mem.len(), 64);
    assert_eq!(c_mem.len(), 64);

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