[][src]Struct threshold_crypto::SecretKeyShare

pub struct SecretKeyShare(_);

A secret key share.

Serde integration

SecretKeyShare implements Deserialize but not Serialize to avoid accidental serialization in insecure contexts. To enable both use the ::serde_impl::SerdeSecret wrapper which implements both Deserialize and Serialize.

Methods

impl SecretKeyShare[src]

pub fn from_mut(fr: &mut Fr) -> Self[src]

Creates a new SecretKeyShare from a mutable reference to a field element. This constructor takes a reference to avoid any unnecessary stack copying/moving of secrets field elements. The field element will be copied bytewise onto the heap, the resulting Box is stored in the SecretKey which is then wrapped in a SecretKeyShare.

WARNING this constructor will overwrite the pointed to Fr element with zeros once it has been copied into a new SecretKeyShare.

pub fn public_key_share(&self) -> PublicKeyShare[src]

Returns the matching public key share.

pub fn sign_g2<H: Into<G2Affine>>(&self, hash: H) -> SignatureShare[src]

Signs the given element of G2.

pub fn sign<M: AsRef<[u8]>>(&self, msg: M) -> SignatureShare[src]

Signs the given message.

pub fn decrypt_share(&self, ct: &Ciphertext) -> Option<DecryptionShare>[src]

Returns a decryption share, or None, if the ciphertext isn't valid.

pub fn decrypt_share_no_verify(&self, ct: &Ciphertext) -> DecryptionShare[src]

Returns a decryption share, without validating the ciphertext.

pub fn reveal(&self) -> String[src]

Generates a non-redacted debug string. This method differs from the Debug implementation in that it does leak the secret prime field element.

Trait Implementations

impl PartialEq<SecretKeyShare> for SecretKeyShare[src]

impl Default for SecretKeyShare[src]

impl Clone for SecretKeyShare[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for SecretKeyShare[src]

impl Debug for SecretKeyShare[src]

impl Distribution<SecretKeyShare> for Standard[src]

fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl<'de> Deserialize<'de> for SecretKeyShare[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]