CoreKeyShare

Type Alias CoreKeyShare 

Source
pub type CoreKeyShare<E> = Valid<DirtyCoreKeyShare<E>>;
Expand description

Core key share

Core key share is type alias to DirtyCoreKeyShare wrapped into Valid<T>, meaning that the key share has been validated that:

  • Number of signers n doesn’t overflow u16::MAX, and that n >= 2
  • Signer index i is less than n
  • Signer public commitment matches the secret share
  • Threshold value is within range 2 <= t <= n
  • All signers commitments sum up to public key

It’s impossible to obtain CoreKeyShare for the key share that doesn’t meet above requirements.

Only immutable access to the key share is provided. If you need to change content of the key share, you need to obtain dirty key share via Valid::into_inner, modify the key share, and validate it again to obtain CoreKeyShare.

Aliased Type§

pub struct CoreKeyShare<E>(/* private fields */);

Implementations§

Source§

impl<E: Curve> CoreKeyShare<E>

Source

pub fn n(&self) -> u16

Returns amount of key co-holders

Source

pub fn min_signers(&self) -> u16

Returns threshold

Threshold is an amount of signers required to cooperate in order to sign a message and/or generate presignature

Source

pub fn shared_public_key(&self) -> NonZero<Point<E>>

Returns public key shared by signers

Trait Implementations§

Source§

impl<E: Curve> AsRef<Valid<DirtyCoreKeyShare<E>>> for CoreKeyShare<E>

Source§

fn as_ref(&self) -> &CoreKeyShare<E>

Converts this type into a shared reference of the (usually inferred) input type.