verify

Function verify 

Source
pub fn verify(
    commitment: &PedersenCommitment,
    value: u64,
    opening: &PedersenOpening,
) -> bool
Expand description

Verify a Pedersen commitment.

§Arguments

  • commitment - The commitment to verify
  • value - The claimed value
  • opening - The opening information

§Returns

true if the commitment is valid, false otherwise.

§Example

use chie_crypto::pedersen::{commit, verify};

let (commitment, opening) = commit(1024);
assert!(verify(&commitment, 1024, &opening));
assert!(!verify(&commitment, 2048, &opening));