pub struct SurjectionProof { /* private fields */ }Available on crate feature
std only.Expand description
Represents a surjection proof.
Implementations§
Source§impl 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>
Available on crate feature actual-rand only.
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>
actual-rand only.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.
Source§impl 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.
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serializes a surjection proof.
The format of this serialization is stable and platform-independent.
Trait Implementations§
Source§impl Clone for SurjectionProof
impl Clone for SurjectionProof
Source§fn clone(&self) -> SurjectionProof
fn clone(&self) -> SurjectionProof
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SurjectionProof
impl Debug for SurjectionProof
Source§impl<'de> Deserialize<'de> for SurjectionProof
Available on crate features serde and hashes only.
impl<'de> Deserialize<'de> for SurjectionProof
Available on crate features
serde and hashes only.Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<SurjectionProof, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<SurjectionProof, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SurjectionProof
Available on crate feature hashes only.
impl Display for SurjectionProof
Available on crate feature
hashes only.Source§impl FromStr for SurjectionProof
impl FromStr for SurjectionProof
Source§impl Hash for SurjectionProof
impl Hash for SurjectionProof
Source§impl Ord for SurjectionProof
impl Ord for SurjectionProof
Source§fn cmp(&self, other: &SurjectionProof) -> Ordering
fn cmp(&self, other: &SurjectionProof) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SurjectionProof
impl PartialEq for SurjectionProof
Source§impl PartialOrd for SurjectionProof
impl PartialOrd for SurjectionProof
Source§impl Serialize for SurjectionProof
Available on crate features serde and hashes only.
impl Serialize for SurjectionProof
Available on crate features
serde and hashes only.impl Eq for SurjectionProof
impl StructuralPartialEq for SurjectionProof
Auto Trait Implementations§
impl Freeze for SurjectionProof
impl RefUnwindSafe for SurjectionProof
impl Send for SurjectionProof
impl Sync for SurjectionProof
impl Unpin for SurjectionProof
impl UnwindSafe for SurjectionProof
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more