Struct threshold_crypto::PublicKeySet
source · pub struct PublicKeySet { /* private fields */ }
Expand description
A public key and an associated set of public key shares.
Implementations§
source§impl PublicKeySet
impl PublicKeySet
sourcepub fn threshold(&self) -> usize
pub fn threshold(&self) -> usize
Returns the threshold t
: any set of t + 1
signature shares can be combined into a full
signature.
sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Returns the public key.
Returns the i
-th public key share.
sourcepub fn combine_signatures<'a, T, I>(&self, shares: I) -> Result<Signature>where
I: IntoIterator<Item = (T, &'a SignatureShare)>,
T: IntoFr,
pub fn combine_signatures<'a, T, I>(&self, shares: I) -> Result<Signature>where
I: IntoIterator<Item = (T, &'a SignatureShare)>,
T: IntoFr,
Combines the shares into a signature that can be verified with the main public key.
sourcepub fn decrypt<'a, T, I>(&self, shares: I, ct: &Ciphertext) -> Result<Vec<u8>>where
I: IntoIterator<Item = (T, &'a DecryptionShare)>,
T: IntoFr,
pub fn decrypt<'a, T, I>(&self, shares: I, ct: &Ciphertext) -> Result<Vec<u8>>where
I: IntoIterator<Item = (T, &'a DecryptionShare)>,
T: IntoFr,
Combines the shares to decrypt the ciphertext.
Trait Implementations§
source§impl Clone for PublicKeySet
impl Clone for PublicKeySet
source§fn clone(&self) -> PublicKeySet
fn clone(&self) -> PublicKeySet
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PublicKeySet
impl Debug for PublicKeySet
source§impl<'de> Deserialize<'de> for PublicKeySet
impl<'de> Deserialize<'de> for PublicKeySet
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Commitment> for PublicKeySet
impl From<Commitment> for PublicKeySet
source§fn from(commit: Commitment) -> PublicKeySet
fn from(commit: Commitment) -> PublicKeySet
Converts to this type from the input type.