Struct prio::server::Server [−][src]
pub struct Server<F> { /* fields omitted */ }
Expand description
Main workhorse of the server.
Implementations
pub fn new(
dimension: usize,
is_first_server: bool,
private_key: PrivateKey
) -> Result<Server<F>, ServerError>
pub fn new(
dimension: usize,
is_first_server: bool,
private_key: PrivateKey
) -> Result<Server<F>, ServerError>
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: F,
share: &[u8]
) -> Result<VerificationMessage<F>, ServerError>
pub fn generate_verification_message(
&mut self,
eval_at: F,
share: &[u8]
) -> Result<VerificationMessage<F>, ServerError>
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<F>,
v2: &VerificationMessage<F>
) -> Result<bool, ServerError>
pub fn aggregate(
&mut self,
share: &[u8],
v1: &VerificationMessage<F>,
v2: &VerificationMessage<F>
) -> Result<bool, ServerError>
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.
Return the current accumulated shares.
These can be merged together using
reconstruct_shares
.
Merge shares from another server.
This modifies the current accumulator.
Errors
Returns an error if other_total_shares.len()
is not equal to this
Choose a random point for polynomial evaluation
The point returned is not one of the roots used for polynomial evaluation.