pub struct SecretShare<C: Ciphersuite> { /* private fields */ }
Expand description
A secret share generated by performing a (t-out-of-n) secret sharing scheme,
generated by a dealer performing generate_with_dealer
.
n
is the total number of shares and t
is the threshold required to reconstruct the secret;
in this case we use Shamir’s secret sharing.
As a solution to the secret polynomial f (a ‘point’), the identifier
is the x-coordinate, and the
value
is the y-coordinate.
To derive a FROST keypair, the receiver of the SecretShare
must call
.into(), which under the hood also performs validation.
Implementations§
Auto-generated by derive_getters::Getters
.
sourcepub fn identifier(&self) -> &Identifier<C>
pub fn identifier(&self) -> &Identifier<C>
The participant identifier of this SecretShare
.
Secret Key.
sourcepub fn commitment(&self) -> &VerifiableSecretSharingCommitment<C>
pub fn commitment(&self) -> &VerifiableSecretSharingCommitment<C>
The commitments to be distributed among signers.
sourcepub fn new(
identifier: Identifier<C>,
signing_share: SigningShare<C>,
commitment: VerifiableSecretSharingCommitment<C>,
) -> Self
pub fn new( identifier: Identifier<C>, signing_share: SigningShare<C>, commitment: VerifiableSecretSharingCommitment<C>, ) -> Self
Create a new SecretShare
instance.
sourcepub fn verify(&self) -> Result<(VerifyingShare<C>, VerifyingKey<C>), Error<C>>
pub fn verify(&self) -> Result<(VerifyingShare<C>, VerifyingKey<C>), Error<C>>
Verifies that a secret share is consistent with a verifiable secret sharing commitment, and returns the derived group info for the participant (their public verification share, and the group public key) if successful.
This ensures that this participant’s share has been generated using the same mechanism as all other signing participants. Note that participants MUST ensure that they have the same view as all other participants of the commitment!
An implementation of vss_verify()
from the spec.
This also implements derive_group_info()
from the spec (which is very similar),
but only for this participant.
Trait Implementations§
source§fn clone(&self) -> SecretShare<C>
fn clone(&self) -> SecretShare<C>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§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>,
source§fn try_from(secret_share: SecretShare<C>) -> Result<Self, Error<C>>
fn try_from(secret_share: SecretShare<C>) -> Result<Self, Error<C>>
Tries to verify a share and construct a KeyPackage
from it.
When participants receive a SecretShare
from the dealer, they
MUST verify the integrity of the share before continuing on to
transform it into a signing/verification keypair. Here, we assume that
every participant has the same view of the commitment issued by the
dealer, but implementations MUST make sure that all participants have
a consistent view of this commitment in practice.
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)