Struct sigma_fun::secp256k1::DL

source ·
pub struct DL<L> { /* private fields */ }
Available on crate feature secp256k1 only.
Expand description

Proves knowledge of x such that A = x * B for some A and B included in the statement.

Trait Implementations§

source§

impl<L: Clone> Clone for DL<L>

source§

fn clone(&self) -> DL<L>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<L: Debug> Debug for DL<L>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<L: Default> Default for DL<L>

source§

fn default() -> DL<L>

Returns the “default value” for a type. Read more
source§

impl<L> Display for DL<L>
where DL<L>: Sigma,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<L: PartialEq> PartialEq for DL<L>

source§

fn eq(&self, other: &DL<L>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<L> Sigma for DL<L>

§

type Witness = Scalar

The witness for the relation.
§

type Statement = (Point, Point)

The elements of the statement the prover is proving.
§

type AnnounceSecret = Scalar

The type for the secret the prover creates when generating the proof.
§

type Announcement = Point

The type for the public announcement the prover sends in the first round of the protocol.
§

type Response = Scalar<Public, Zero>

The type for the response the prover sends in the last round of the protocol.
§

type ChallengeLength = L

The length as a typenum
source§

fn respond( &self, witness: &Self::Witness, _statement: &Self::Statement, announce_secret: Self::AnnounceSecret, _announce: &Self::Announcement, challenge: &GenericArray<u8, Self::ChallengeLength> ) -> Self::Response

Generates the prover’s response for the verifier’s challenge.
source§

fn announce( &self, statement: &Self::Statement, announce_secret: &Self::AnnounceSecret ) -> Self::Announcement

Generates the prover’s announcement message.
source§

fn sample_response<Rng: CryptoRng + RngCore>( &self, rng: &mut Rng ) -> Self::Response

Uniformly samples a response from the response space of the Sigma protocol.
source§

fn implied_announcement( &self, statement: &Self::Statement, challenge: &GenericArray<u8, Self::ChallengeLength>, response: &Self::Response ) -> Option<Self::Announcement>

Computes what the announcement must be for the response to be valid.
source§

fn hash_statement<H: Update>(&self, hash: &mut H, statement: &Self::Statement)

Hashes the statement.
source§

fn hash_announcement<H: Update>( &self, hash: &mut H, announcement: &Self::Announcement )

Hashes the announcement.
source§

fn hash_witness<H: Update>(&self, hash: &mut H, witness: &Self::Witness)

Hashes the witness.
source§

fn gen_announce_secret<Rng: CryptoRng + RngCore>( &self, _witness: &Self::Witness, rng: &mut Rng ) -> Self::AnnounceSecret

Generates the secret data to create the announcement
source§

impl<L> Writable for DL<L>

source§

fn write_to<W: Write>(&self, w: &mut W) -> Result

Asks the thing to write itself to W.
source§

impl<L> StructuralPartialEq for DL<L>

Auto Trait Implementations§

§

impl<L> RefUnwindSafe for DL<L>
where L: RefUnwindSafe,

§

impl<L> Send for DL<L>
where L: Send,

§

impl<L> Sync for DL<L>
where L: Sync,

§

impl<L> Unpin for DL<L>
where L: Unpin,

§

impl<L> UnwindSafe for DL<L>
where L: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.