KeyPackage

Struct KeyPackage 

Source
pub struct KeyPackage<C: Ciphersuite> { /* private fields */ }
Expand description

A FROST keypair, which can be generated either by a trusted dealer or using a DKG.

When using a central dealer, SecretShares are distributed to participants, who then perform verification, before deriving KeyPackages, which they store to later use during signing.

Implementations§

Source§

impl<C: Ciphersuite> KeyPackage<C>

Auto-generated by derive_getters::Getters.

Source

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

Denotes the participant identifier each secret share key package is owned by.

Source

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

This participant’s signing share. This is secret.

Source

pub fn verifying_share(&self) -> &VerifyingShare<C>

This participant’s public key.

Source

pub fn verifying_key(&self) -> &VerifyingKey<C>

The public verifying key that represents the entire group.

Source

pub fn min_signers(&self) -> &u16

Get field min_signers from instance of KeyPackage.

Source§

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

Source

pub fn new( identifier: Identifier<C>, signing_share: SigningShare<C>, verifying_share: VerifyingShare<C>, verifying_key: VerifyingKey<C>, min_signers: u16, ) -> Self

Create a new KeyPackage instance.

Source§

impl<C> KeyPackage<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 KeyPackage<C>

Source§

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

Returns a duplicate 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 KeyPackage<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 KeyPackage<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 KeyPackage<C>

Source§

fn eq(&self, other: &KeyPackage<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 KeyPackage<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 KeyPackage<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 KeyPackage<C>

Source§

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

Auto Trait Implementations§

§

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

§

impl<C> RefUnwindSafe for KeyPackage<C>

§

impl<C> Send for KeyPackage<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 KeyPackage<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 KeyPackage<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 KeyPackage<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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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>,