Trait tari_crypto::commitment::HomomorphicCommitmentFactory[][src]

pub trait HomomorphicCommitmentFactory {
    type P: PublicKey;
    fn commit(
        &self,
        k: &<Self::P as PublicKey>::K,
        v: &<Self::P as PublicKey>::K
    ) -> HomomorphicCommitment<Self::P>;
fn zero(&self) -> HomomorphicCommitment<Self::P>;
fn open(
        &self,
        k: &<Self::P as PublicKey>::K,
        v: &<Self::P as PublicKey>::K,
        commitment: &HomomorphicCommitment<Self::P>
    ) -> bool;
fn commit_value(
        &self,
        k: &<Self::P as PublicKey>::K,
        value: u64
    ) -> HomomorphicCommitment<Self::P>;
fn open_value(
        &self,
        k: &<Self::P as PublicKey>::K,
        v: u64,
        commitment: &HomomorphicCommitment<Self::P>
    ) -> bool; }

Associated Types

Loading content...

Required methods

fn commit(
    &self,
    k: &<Self::P as PublicKey>::K,
    v: &<Self::P as PublicKey>::K
) -> HomomorphicCommitment<Self::P>
[src]

Create a new commitment with the value and blinding factor provided. The implementing type will provide the base values

fn zero(&self) -> HomomorphicCommitment<Self::P>[src]

return an identity point for addition using the specified base point. This is a commitment to zero with a zero blinding factor on the base point

fn open(
    &self,
    k: &<Self::P as PublicKey>::K,
    v: &<Self::P as PublicKey>::K,
    commitment: &HomomorphicCommitment<Self::P>
) -> bool
[src]

Test whether the given keys open the given commitment

fn commit_value(
    &self,
    k: &<Self::P as PublicKey>::K,
    value: u64
) -> HomomorphicCommitment<Self::P>
[src]

Create a commitment from a spending key and a integer value

fn open_value(
    &self,
    k: &<Self::P as PublicKey>::K,
    v: u64,
    commitment: &HomomorphicCommitment<Self::P>
) -> bool
[src]

Test whether the given private key and value open the given commitment

Loading content...

Implementors

impl HomomorphicCommitmentFactory for PedersenCommitmentFactory[src]

type P = RistrettoPublicKey

Loading content...