[][src]Struct mpvss_rs::Participant

pub struct Participant {
    pub mpvss: MPVSS,
    pub privatekey: BigInt,
    pub publickey: BigInt,
}

A participant represents one party in the secret sharing scheme. The participant can share a secret among a group of other participants and it is then called the "dealer". The receiving participants that receive a part of the secret can use it to reconstruct the secret Therefore the partticipants need to collaborate and exchange their parts. A participant represents as a Node in the Distributed Public NetWork

Fields

mpvss: MPVSSprivatekey: BigIntpublickey: BigInt

Implementations

impl Participant[src]

pub fn new() -> Self[src]

Create A default participant

pub fn initialize(&mut self)[src]

Initializes a new participant with the default MPVSS.

pub fn distribute(
    &mut self,
    secret: BigInt,
    publickeys: Vec<BigInt>,
    threshold: u32,
    polynomial: Polynomial,
    w: BigInt
) -> DistributionSharesBox
[src]

Takes a secret as input and returns the distribution shares Box which is going to be submitted to all the participants the secret is going to be shared with. Those participants are specified by their public keys. They use the distribution shares box to verify that the shares are correct (without learning anything about the shares that are not supposed to be decrypted by them) and extract their encrypted shares. In fact, the distribution shares box can be published to everyone allowing even external parties to verify the integrity of the shares.

  • Parameters:
    • secret: The value that is going to be shared among the other participants.
    • publicKeys: Array of public keys of each participant the secret is to be shared with.
    • threshold: The number of shares that is needed in order to reconstruct the secret. It must not be greater than the total number of participants.
    • polynomial: The polynomial which is going to be used to produce sampling points which represent the shares. Those sampling points allow the receiving participants to reconstruct the polynomial and with it the secret. The degree of the polynomial must be threshold-1.
    • w: An arbitrary chosen value needed for creating the proof that the shares in the distribution shares box are consistent.
  • Requires:
    • threshold <= number of participants
    • degree of polynomial = threshold - 1
  • Returns: The distribution shares box that is published so everyone (especially but not only the participants) can check the shares' integrity. Furthermore the participants extract their shares from it.

pub fn distribute_secret(
    &mut self,
    secret: BigInt,
    publickeys: Vec<BigInt>,
    threshold: u32
) -> DistributionSharesBox
[src]

Takes a secret as input and returns the distribution shares Box which is going to be submitted to all the participants the secret is going to be shared with. Those participants are specified by their public keys. They use the distribution shares box to verify that the shares are correct (without learning anything about the shares that are not supposed to be decrypted by them) and extract their encrypted shares. In fact, the distribution shares box can be published to everyone allowing even external parties to verify the integrity of the shares.

  • Parameters:
    • secret: The value that is going to be shared among the other participants.
    • publicKeys: Array of public keys of each participant the secret is to be shared with.
    • threshold: The number of shares that is needed in order to reconstruct the secret. It must not be greater than the total number of participants.
  • Requires: threshold <= number of participants
  • Returns: The distribution shares Box that is published to everyone (especially but not only the participants) can check the shares' integrity. Furthermore the participants extract their shares from it.

pub fn extract_share(
    &self,
    shares_box: &DistributionSharesBox,
    private_key: &BigInt,
    w: &BigInt
) -> Option<ShareBox>
[src]

Extracts the share from a given distribution shares box that is addressed to the calling participant. The extracted share is bundled with a proof which allows the other participants to verify the share's correctness.

  • Parameters:
    • distributionBundle: The distribution shares box that consists the share to be extracted.
    • privateKey: The participant's private key used to decrypt the share.
    • w: An arbitrary chosen value needed for creating the proof that the share is correct.
  • Returns: The share box that is to be submitted to all the other participants in order to reconstruct the secret. It consists of the share itself and the proof that allows the receiving participant to verify its correctness. Return None if the distribution shares box does not contain a share for the participant.

pub fn extract_secret_share(
    &self,
    shares_box: &DistributionSharesBox,
    private_key: &BigInt
) -> Option<ShareBox>
[src]

Extracts the share from a given distribution shares box that is addressed to the calling participant. The extracted share is boxed with a proof which allows the other participants to verify the share's correctness.

  • Parameters:
    • shares_box: The distribution shares box that consists the share to be extracted.
    • private_key: The participant's private key used to decrypt the share.
  • Returns: The share box that is to be submitted to all the other participants in order to reconstruct the secret. It consists of the share itself and the proof that allows the receiving participant to verify its correctness. Return None if the distribution shares box does not contain a share for the participant.

Trait Implementations

impl Clone for Participant[src]

impl Debug for Participant[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.