pub struct Zkp {
    challenge: Scalar,
    response: Scalar,
}
Expand description

Proof of correct decryption. Note: if the goal is to reduce the size of a proof, it is better to store the challenge and the response. If on the other hand we want to allow for batch verification of proofs, we should store the announcements and the response.

Fields§

§challenge: Scalar§response: Scalar

Implementations§

source§

impl Zkp

source

pub const BYTES_LEN: usize = 64usize

source

pub fn generate<R>( base_1: &GroupElement, base_2: &GroupElement, point_1: &GroupElement, point_2: &GroupElement, dlog: &Scalar, rng: &mut R ) -> Selfwhere R: CryptoRng + RngCore,

Generate a DLEQ proof

source

pub fn verify( &self, base_1: &GroupElement, base_2: &GroupElement, point_1: &GroupElement, point_2: &GroupElement ) -> bool

Verify a DLEQ proof

source

pub fn to_bytes(&self) -> [u8; 64]

source

pub fn write_to_bytes(&self, output: &mut [u8])

source

pub fn from_bytes(slice: &[u8]) -> Option<Self>

Trait Implementations§

source§

impl Clone for Zkp

source§

fn clone(&self) -> Zkp

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 Debug for Zkp

source§

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

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

impl Hash for Zkp

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<Zkp> for Zkp

source§

fn eq(&self, other: &Zkp) -> 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 Eq for Zkp

source§

impl StructuralEq for Zkp

source§

impl StructuralPartialEq for Zkp

Auto Trait Implementations§

§

impl RefUnwindSafe for Zkp

§

impl Send for Zkp

§

impl Sync for Zkp

§

impl Unpin for Zkp

§

impl UnwindSafe for Zkp

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V