Crate tiny_ped_com [−] [src]
A small Rust library for Pedersen commitments over elliptc curves.
Example usage:
let mut rng = OsRng::new().unwrap(); let val = tiny_ped_com::CommitmentValue::from_u64(3); let (verifier_pub_key, mut verifier) = tiny_ped_com::CommitVerifier::init(&mut rng); let (commitment, commitment_opening) = tiny_ped_com::Committer::commit(&mut rng, &val, &verifier_pub_key); verifier.receive_commitment(commitment); let did_verify = verifier.verify(&val, &commitment_opening); assert_eq!(did_verify, true);
Structs
CommitVerifier |
CommitVerifier is the party who is verifying the commitment. They send the first message to the Committer and receive two messages from the sender. |
Commitment |
The Commitment created by the Committer. Sent to the Verifier so that the committer is bound to some value. |
CommitmentOpening |
The opening to the commitment. Sent by the committer to the verifier in the third round of communcation to prove that the commitment was for the associated value. |
CommitmentValue |
The value that the Committer is comitting to. Must be a valid scalar in the Ristretto field. |
Committer |
Committer is the party who is commiting to a value. |
VerifierPublicKey |
The Verifier's public key. Sent to the Committer is the first round of communication. |