[][src]Trait tari_crypto::range_proof::RangeProofService

pub trait RangeProofService {
    type P: Sized;
    type K: SecretKey;
    type PK: PublicKey<K = Self::K>;
    fn construct_proof(
        &self,
        key: &Self::K,
        value: u64
    ) -> Result<Self::P, RangeProofError>;
fn verify(
        &self,
        proof: &Self::P,
        commitment: &HomomorphicCommitment<Self::PK>
    ) -> bool; }

Associated Types

type P: Sized

type K: SecretKey

type PK: PublicKey<K = Self::K>

Loading content...

Required methods

fn construct_proof(
    &self,
    key: &Self::K,
    value: u64
) -> Result<Self::P, RangeProofError>

Construct a new range proof for the given secret key and value. The resulting proof will be sufficient evidence that the prover knows the secret key and value, and that the value lies in the range determined by the service.

fn verify(
    &self,
    proof: &Self::P,
    commitment: &HomomorphicCommitment<Self::PK>
) -> bool

Verify the range proof against the given commitment. If this function returns true, it attests to the commitment having a value in the range [0; 2^64-1] and that the prover knew both the value and private key.

Loading content...

Implementors

impl RangeProofService for DalekRangeProofService[src]

type K = RistrettoSecretKey

type P = Vec<u8>

type PK = RistrettoPublicKey

Loading content...