[][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.

Implementations

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 Clone for SecretKeyShare[src]

impl Debug for SecretKeyShare[src]

impl Default for SecretKeyShare[src]

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

impl Distribution<SecretKeyShare> for Standard[src]

Can be used to create a new random instance of SecretKeyShare. This is only useful for testing purposes as such a key has not been derived from a SecretKeySet.

impl Eq for SecretKeyShare[src]

impl PartialEq<SecretKeyShare> for SecretKeyShare[src]

impl StructuralEq for SecretKeyShare[src]

impl StructuralPartialEq for SecretKeyShare[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,