frost_core::keys

Struct SecretShare

source
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§

source§

impl<C: Ciphersuite> SecretShare<C>

Auto-generated by derive_getters::Getters.

source

pub fn identifier(&self) -> &Identifier<C>

The participant identifier of this SecretShare.

source

pub fn signing_share(&self) -> &SigningShare<C>

Secret Key.

source

pub fn commitment(&self) -> &VerifiableSecretSharingCommitment<C>

The commitments to be distributed among signers.

source§

impl<C> SecretShare<C>
where C: Ciphersuite,

source

pub fn new( identifier: Identifier<C>, signing_share: SigningShare<C>, commitment: VerifiableSecretSharingCommitment<C>, ) -> Self

Create a new SecretShare instance.

source

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.

source§

impl<C> SecretShare<C>
where C: Ciphersuite,

source

pub fn serialize(&self) -> Result<Vec<u8>, Error<C>>

Available on crate feature serialization only.

Serialize the struct into a Vec.

source

pub fn deserialize(bytes: &[u8]) -> Result<Self, Error<C>>

Available on crate feature serialization only.

Deserialize the struct from a slice of bytes.

Trait Implementations§

source§

impl<C: Clone + Ciphersuite> Clone for SecretShare<C>

source§

fn clone(&self) -> SecretShare<C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<C: Debug + Ciphersuite> Debug for SecretShare<C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, C> Deserialize<'de> for SecretShare<C>
where C: Ciphersuite,

source§

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<C: PartialEq + Ciphersuite> PartialEq for SecretShare<C>

source§

fn eq(&self, other: &SecretShare<C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<C> Serialize for SecretShare<C>
where C: Ciphersuite,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<C> TryFrom<SecretShare<C>> for KeyPackage<C>
where C: Ciphersuite,

source§

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.

source§

type Error = Error<C>

The type returned in the event of a conversion error.
source§

impl<C: Ciphersuite> Zeroize for SecretShare<C>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
source§

impl<C: Eq + Ciphersuite> Eq for SecretShare<C>

source§

impl<C: Ciphersuite> StructuralPartialEq for SecretShare<C>

Auto Trait Implementations§

§

impl<C> Freeze for SecretShare<C>
where <<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar: Freeze,

§

impl<C> RefUnwindSafe for SecretShare<C>

§

impl<C> Send for SecretShare<C>
where C: Send, <<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar: Send, <<C as Ciphersuite>::Group as Group>::Element: Send,

§

impl<C> Sync for SecretShare<C>
where C: Sync, <<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar: Sync, <<C as Ciphersuite>::Group as Group>::Element: Sync,

§

impl<C> Unpin for SecretShare<C>
where C: Unpin, <<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar: Unpin, <<C as Ciphersuite>::Group as Group>::Element: Unpin,

§

impl<C> UnwindSafe for SecretShare<C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,