Struct prio::server::Server[][src]

pub struct Server { /* fields omitted */ }

Main workhorse of the server.

Implementations

impl Server[src]

pub fn new(
    dimension: usize,
    is_first_server: bool,
    private_key: PrivateKey
) -> Server
[src]

Construct a new server instance

Params:

  • dimension: the number of elements in the aggregation vector.
  • is_first_server: only one of the servers should have this true.
  • private_key: the private key for decrypting the share of the proof.

pub fn generate_verification_message(
    &mut self,
    eval_at: Field,
    share: &[u8]
) -> Option<VerificationMessage>
[src]

Generate verification message from an encrypted share

This decrypts the share of the proof and constructs the VerificationMessage. The eval_at field should be generate by choose_eval_at.

pub fn aggregate(
    &mut self,
    share: &[u8],
    v1: &VerificationMessage,
    v2: &VerificationMessage
) -> Result<bool, ServerError>
[src]

Add the content of the encrypted share into the accumulator

This only changes the accumulator if the verification messages v1 and v2 indicate that the share passed validation.

pub fn total_shares(&self) -> &[Field][src]

Return the current accumulated shares.

These can be merged together using reconstruct_shares.

pub fn merge_total_shares(
    &mut self,
    other_total_shares: &[Field]
) -> Result<(), ServerError>
[src]

Merge shares from another server.

This modifies the current accumulator.

Errors

Returns an error if other_total_shares.len() is not equal to this

pub fn choose_eval_at(&self) -> Field[src]

Choose a random point for polynomial evaluation

The point returned is not one of the roots used for polynomial evaluation.

Trait Implementations

impl Debug for Server[src]

Auto Trait Implementations

impl RefUnwindSafe for Server

impl Send for Server

impl Sync for Server

impl Unpin for Server

impl UnwindSafe for Server

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, 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>,