jf_commitment

Trait CommitmentScheme

Source
pub trait CommitmentScheme {
    type Input;
    type Output: Clone + Debug + PartialEq + Eq + Hash;
    type Randomness: Clone + Debug + PartialEq + Eq + UniformRand;
    type Error: Error;

    // Required methods
    fn commit<T: Borrow<Self::Input>>(
        input: T,
        r: Option<&Self::Randomness>,
    ) -> Result<Self::Output, Self::Error>;
    fn verify<T: Borrow<Self::Input>>(
        input: T,
        r: Option<&Self::Randomness>,
        comm: &Self::Output,
    ) -> Result<Result<(), ()>, Self::Error>;
}

Required Associated Types§

Source

type Input

Input to the commitment

Source

type Output: Clone + Debug + PartialEq + Eq + Hash

The type of output commitment value

Source

type Randomness: Clone + Debug + PartialEq + Eq + UniformRand

The type of the hiding/blinding factor

Source

type Error: Error

Error type

Required Methods§

Source

fn commit<T: Borrow<Self::Input>>( input: T, r: Option<&Self::Randomness>, ) -> Result<Self::Output, Self::Error>

Commit algorithm that takes input and blinding randomness r (optional for hiding commitment schemes), outputs a commitment.

Source

fn verify<T: Borrow<Self::Input>>( input: T, r: Option<&Self::Randomness>, comm: &Self::Output, ) -> Result<Result<(), ()>, Self::Error>

Verify algorithm that output Ok if accepted, or Err if rejected.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§