pub trait Commitment {
    type Seed;
    type Output;

    // Required methods
    fn new(seed: Self::Seed) -> Self;
    fn input(&mut self, input: &[u8]);
    fn finish(self) -> Self::Output;
    fn check(comm1: &Self::Output, comm2: &Self::Output) -> bool;
}
Expand description

Generic commitment scheme.

Required Associated Types§

source

type Seed

The type used to initialize a commitment.

source

type Output

The output type of the commitment.

Required Methods§

source

fn new(seed: Self::Seed) -> Self

A new commitment initialized with seed.

source

fn input(&mut self, input: &[u8])

A method to add data to the commitment.

source

fn finish(self) -> Self::Output

Complete the commitment.

source

fn check(comm1: &Self::Output, comm2: &Self::Output) -> bool

Check if two commitments are equal.

Object Safety§

This trait is not object safe.

Implementors§