Skip to main content

verify_commitment

Function verify_commitment 

Source
pub fn verify_commitment(key: &KeriPublicKey, commitment: &Said) -> bool
Expand description

Verify that a public key satisfies a commitment.

Args:

  • key - The next public key to check, carrying its curve.
  • commitment - The commitment Said from a previous event’s n field.

Usage:

use auths_keri::{compute_next_commitment, verify_commitment, KeriPublicKey};
let key = KeriPublicKey::Ed25519([1u8; 32]);
let c = compute_next_commitment(&key);
assert!(verify_commitment(&key, &c));
assert!(!verify_commitment(&KeriPublicKey::Ed25519([2u8; 32]), &c));