Struct secp256k1_zkp::SurjectionProof
source · [−]pub struct SurjectionProof { /* private fields */ }
Expand description
Represents a surjection proof.
Implementations
sourceimpl SurjectionProof
impl SurjectionProof
sourcepub fn new<C: Signing, R: Rng>(
secp: &Secp256k1<C>,
rng: &mut R,
codomain_tag: Tag,
codomain_blinding_factor: Tweak,
domain: &[(Generator, Tag, Tweak)]
) -> Result<SurjectionProof, Error>
pub fn new<C: Signing, R: Rng>(
secp: &Secp256k1<C>,
rng: &mut R,
codomain_tag: Tag,
codomain_blinding_factor: Tweak,
domain: &[(Generator, Tag, Tweak)]
) -> Result<SurjectionProof, Error>
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.
sourceimpl SurjectionProof
impl SurjectionProof
sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, Error>
pub fn from_slice(bytes: &[u8]) -> Result<Self, Error>
Creates a surjection proof from a slice of bytes.
Trait Implementations
sourceimpl Clone for SurjectionProof
impl Clone for SurjectionProof
sourcefn clone(&self) -> SurjectionProof
fn clone(&self) -> SurjectionProof
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SurjectionProof
impl Debug for SurjectionProof
sourceimpl FromStr for SurjectionProof
impl FromStr for SurjectionProof
sourceimpl Hash for SurjectionProof
impl Hash for SurjectionProof
sourceimpl PartialEq<SurjectionProof> for SurjectionProof
impl PartialEq<SurjectionProof> for SurjectionProof
sourcefn eq(&self, other: &SurjectionProof) -> bool
fn eq(&self, other: &SurjectionProof) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SurjectionProof) -> bool
fn ne(&self, other: &SurjectionProof) -> bool
This method tests for !=
.
impl Eq for SurjectionProof
impl StructuralEq for SurjectionProof
impl StructuralPartialEq for SurjectionProof
Auto Trait Implementations
impl RefUnwindSafe for SurjectionProof
impl Send for SurjectionProof
impl Sync for SurjectionProof
impl Unpin for SurjectionProof
impl UnwindSafe for SurjectionProof
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more