Struct blsttc::SecretKeySet
source · [−]pub struct SecretKeySet { /* private fields */ }
Expand description
A secret key and an associated set of secret key shares.
Implementations
sourceimpl 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 constructor is identical to the SecretKeySet::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 constructor is identical to the SecretKeySet::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.
sourcepub fn secret_key(&self) -> SecretKey
pub fn secret_key(&self) -> SecretKey
Returns the secret master key.
sourcepub fn derive_child(&self, index: &[u8]) -> Self
pub fn derive_child(&self, index: &[u8]) -> Self
Derives a child secret key set for a given index.
sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<Self>
pub fn from_bytes(bytes: Vec<u8>) -> Result<Self>
Deserializes from big endian bytes
Trait Implementations
sourceimpl Clone for SecretKeySet
impl Clone for SecretKeySet
sourcefn clone(&self) -> SecretKeySet
fn clone(&self) -> SecretKeySet
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl From<Poly> for SecretKeySet
impl From<Poly> for SecretKeySet
sourcefn from(poly: Poly) -> SecretKeySet
fn from(poly: Poly) -> SecretKeySet
Performs the conversion.
sourceimpl PartialEq<SecretKeySet> for SecretKeySet
impl PartialEq<SecretKeySet> for SecretKeySet
sourcefn eq(&self, other: &SecretKeySet) -> bool
fn eq(&self, other: &SecretKeySet) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SecretKeySet) -> bool
fn ne(&self, other: &SecretKeySet) -> bool
This method tests for !=
.
impl Eq for SecretKeySet
impl StructuralEq for SecretKeySet
impl StructuralPartialEq for SecretKeySet
Auto Trait Implementations
impl RefUnwindSafe for SecretKeySet
impl Send for SecretKeySet
impl Sync for SecretKeySet
impl Unpin for SecretKeySet
impl UnwindSafe for SecretKeySet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more