[−][src]Struct threshold_crypto::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]
fn eq(&self, other: &SecretKeyShare) -> bool
[src]
fn ne(&self, other: &SecretKeyShare) -> bool
[src]
impl Default for SecretKeyShare
[src]
fn default() -> SecretKeyShare
[src]
impl Clone for SecretKeyShare
[src]
fn clone(&self) -> 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<R: Rng + ?Sized>(&self, rng: &mut R) -> SecretKeyShare
[src]
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
[src]
R: Rng,
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]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Send for SecretKeyShare
impl Sync for SecretKeyShare
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,