[][src]Function indy_crypto::utils::commitment::get_generalized_pedersen_commitment

pub fn get_generalized_pedersen_commitment(
    to_commit: Vec<(&BigNumber, &BigNumber)>,
    modulus: &BigNumber,
    ctx: &mut BigNumberContext
) -> IndyCryptoResult<BigNumber>

Generate a pedersen commitment over n values

Arguments

  • to_commit - a list of 2-tuples where the first element of the tuple is a generator and the second is the value being committed to, like [(g_1, m_1), (g_2, m_2), (g_3, m_3), ... (g_i, m_i)]
  • modulus - all computations are done this modulo
  • ctx - big number context

Result

Return the pedersen commitment, i.e (g_1^m_1)*(g_2^m_2)*...(g_i^m_i)*(gen_2^r)