CommitmentScheme

Trait CommitmentScheme 

Source
pub trait CommitmentScheme {
    type Output: ToBytes + Clone + Default + Eq + Hash + Debug;
    type Parameters: Clone;
    type Randomness: Clone + ToBytes + Default + Eq + UniformRand + Debug;

    // Required methods
    fn setup<R: Rng>(r: &mut R) -> Result<Self::Parameters, Error>;
    fn commit(
        parameters: &Self::Parameters,
        input: &[u8],
        r: &Self::Randomness,
    ) -> Result<Self::Output, Error>;
}

Required Associated Types§

Required Methods§

Source

fn setup<R: Rng>(r: &mut R) -> Result<Self::Parameters, Error>

Source

fn commit( parameters: &Self::Parameters, input: &[u8], r: &Self::Randomness, ) -> Result<Self::Output, Error>

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§

Source§

impl CommitmentScheme for mmr_crypto_primitives::commitment::blake2s::Commitment

Source§

impl<C: ProjectiveCurve, I: InjectiveMap<C>, W: Window> CommitmentScheme for PedersenCommCompressor<C, I, W>

Source§

impl<C: ProjectiveCurve, W: Window> CommitmentScheme for mmr_crypto_primitives::commitment::pedersen::Commitment<C, W>