Struct secp256k1_zkp::SurjectionProof[][src]

pub struct SurjectionProof { /* fields omitted */ }

Represents a surjection proof.

Implementations

impl SurjectionProof[src]

pub fn new<C: Signing, R: Rng>(
    secp: &Secp256k1<C>,
    rng: &mut R,
    codomain_tag: Tag,
    codomain_blinding_factor: SecretKey,
    domain: &[(Generator, Tag, SecretKey)]
) -> Result<SurjectionProof, Error>
[src]

Prove that a given tag - when blinded - is contained within another set of blinded tags.

Mathematically, we are proving that there exists a surjective mapping between the domain and codomain of tags. Blinding a tag produces a Generator. As such, to create this proof we need to provide the [Generator]s and the respective blinding factors that were used to create them.

impl SurjectionProof[src]

pub fn from_slice(bytes: &[u8]) -> Result<Self, Error>[src]

Creates a surjection proof from a slice of bytes.

pub fn serialize(&self) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Serializes a surjection proof.

The format of this serialization is stable and platform-independent.

#[must_use]
pub fn verify<C: Verification>(
    &self,
    secp: &Secp256k1<C>,
    codomain: Generator,
    domain: &[Generator]
) -> bool
[src]

Verify a surjection proof.

Trait Implementations

impl Debug for SurjectionProof[src]

impl PartialEq<SurjectionProof> for SurjectionProof[src]

impl StructuralPartialEq for SurjectionProof[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.