Struct threshold_crypto::SecretKeySet
source · pub struct SecretKeySet { /* private fields */ }
Expand description
A secret key and an associated set of secret key shares.
Implementations§
source§impl SecretKeySet
impl SecretKeySet
sourcepub fn random<R: Rng>(threshold: usize, rng: &mut R) -> Self
pub fn random<R: Rng>(threshold: usize, rng: &mut R) -> Self
Creates a set of secret key shares, where any threshold + 1
of them can collaboratively
sign and decrypt. This constuctor is identical to the SecretKey::try_random()
in every
way except that this constructor panics if the other returns an error.
Panic
Panics if the threshold
is too large for the coefficients to fit into a Vec
.
sourcepub fn try_random<R: Rng>(threshold: usize, rng: &mut R) -> Result<Self>
pub fn try_random<R: Rng>(threshold: usize, rng: &mut R) -> Result<Self>
Creates a set of secret key shares, where any threshold + 1
of them can collaboratively
sign and decrypt. This constuctor is identical to the SecretKey::random()
in every
way except that this constructor returns an Err
where the random
would panic.
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.
Returns the i
-th secret key share.
sourcepub fn public_keys(&self) -> PublicKeySet
pub fn public_keys(&self) -> PublicKeySet
Returns the corresponding public key set. That information can be shared publicly.