[][src]Struct xaynet::client::Participant

pub struct Participant {
    pub pk: ParticipantPublicKey,
    pub sk: ParticipantSecretKey,
    pub sum_signature: ParticipantTaskSignature,
    // some fields omitted
}

A participant in the PET protocol layer.

Fields

pk: ParticipantPublicKeysk: ParticipantSecretKeysum_signature: ParticipantTaskSignature

Implementations

impl Participant[src]

pub fn new() -> Result<Self, InitError>[src]

Create a participant.

Errors

Fails if there is insufficient system entropy to generate secrets.

pub fn compute_signatures(&mut self, round_seed: &[u8])[src]

Compute the sum and update signatures for the given round seed.

pub fn check_task(&mut self, round_sum: f64, round_update: f64) -> Task[src]

Check eligibility for a task given probabilities for Sum and Update selection in this round.

Returns the Task selected for this round.

pub fn compose_sum_message(&mut self, pk: &CoordinatorPublicKey) -> MessageOwned[src]

Compose a sum message given the coordinator public key.

pub fn compose_update_message(
    &self,
    pk: CoordinatorPublicKey,
    sum_dict: &SumDict,
    scalar: f64,
    local_model: Model
) -> MessageOwned
[src]

Compose an update message given the coordinator public key, sum dictionary, model scalar and local model update.

pub fn compose_sum2_message(
    &self,
    pk: CoordinatorPublicKey,
    seed_dict: &UpdateSeedDict,
    mask_len: usize
) -> Result<MessageOwned, PetError>
[src]

Compose a sum2 message given the coordinator public key, seed dictionary and mask length.

Errors

Returns a PetError if there is a problem extracting the seed dictionary, or computing the global mask.

pub fn seal_message(
    &self,
    pk: &CoordinatorPublicKey,
    message: &MessageOwned
) -> Vec<u8>
[src]

Sign the given message with the participant secret key, and encrypt the signed message with the given public key.

Trait Implementations

impl Debug for Participant[src]

impl Default 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> Instrument 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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]