pub struct SecretShare<S: CurveScalar> {
pub index: u32,
/* private fields */
}Expand description
A secret share from DKG
§Security
This struct holds secret key material. It implements ZeroizeOnDrop
to ensure the scalar is zeroed when the share goes out of scope.
Fields§
§index: u32Shareholder index (1-indexed, as per Shamir convention)
Implementations§
Sourcepub fn new(index: u32, scalar: S) -> Result<Self, Error>
pub fn new(index: u32, scalar: S) -> Result<Self, Error>
Construct a share.
§Errors
Error::InvalidIndex if index is 0 — Shamir indices are
1-indexed, and index 0 is the secret itself. This returns rather than
panicking: a node parsing an index off the wire must not be
abortable by a peer.
Derive public key share y_i = g^{x_i}
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more