Struct prio::server::Server [−][src]
Main workhorse of the server.
Implementations
impl Server
[src]
pub fn new(
dimension: usize,
is_first_server: bool,
private_key: PrivateKey
) -> Server
[src]
dimension: usize,
is_first_server: bool,
private_key: PrivateKey
) -> Server
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]
&mut self,
eval_at: Field,
share: &[u8]
) -> Option<VerificationMessage>
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]
&mut self,
share: &[u8],
v1: &VerificationMessage,
v2: &VerificationMessage
) -> 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.
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]
&mut self,
other_total_shares: &[Field]
) -> Result<(), ServerError>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,