[−][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
.
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]
fn clone(&self) -> SecretKeyShare
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SecretKeyShare
[src]
impl Default for SecretKeyShare
[src]
fn default() -> SecretKeyShare
[src]
impl<'de> Deserialize<'de> for SecretKeyShare
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
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
.
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> SecretKeyShare
[src]
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
[src]
R: Rng,
impl Eq for SecretKeyShare
[src]
impl PartialEq<SecretKeyShare> for SecretKeyShare
[src]
fn eq(&self, other: &SecretKeyShare) -> bool
[src]
fn ne(&self, other: &SecretKeyShare) -> bool
[src]
impl StructuralEq for SecretKeyShare
[src]
impl StructuralPartialEq for SecretKeyShare
[src]
Auto Trait Implementations
impl RefUnwindSafe for SecretKeyShare
impl Send for SecretKeyShare
impl Sync for SecretKeyShare
impl Unpin for SecretKeyShare
impl UnwindSafe for SecretKeyShare
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,