pub struct OprfServer<CS: CipherSuite> { /* private fields */ }Expand description
A server which engages with a OprfClient in base mode, meaning that the OPRF outputs are not verifiable.
Implementations§
Source§impl<CS: CipherSuite> OprfServer<CS>
impl<CS: CipherSuite> OprfServer<CS>
Sourcepub fn new<R: TryRng + TryCryptoRng>(rng: &mut R) -> Result<Self>
pub fn new<R: TryRng + TryCryptoRng>(rng: &mut R) -> Result<Self>
Produces a new instance of a OprfServer using a supplied RNG
§Errors
Error::Protocol if the protocol fails and can’t be completed.
Sourcepub fn new_with_key(private_key_bytes: &[u8]) -> Result<Self>
pub fn new_with_key(private_key_bytes: &[u8]) -> Result<Self>
Produces a new instance of a OprfServer using a supplied set of bytes to represent the server’s private key
§Errors
Error::Deserialization if the private key is not a valid point on
the group or zero.
Sourcepub fn new_from_seed(seed: &[u8], info: &[u8]) -> Result<Self>
pub fn new_from_seed(seed: &[u8], info: &[u8]) -> Result<Self>
Produces a new instance of a OprfServer using a supplied set of bytes which are used as a seed to derive the server’s private key.
Corresponds to DeriveKeyPair() function from the VOPRF specification.
§Errors
Error::DeriveKeyPairif theinputandseedtogether are longer thenu16::MAX - 3.Error::Protocolif the protocol fails and can’t be completed.
Sourcepub fn blind_evaluate(
&self,
blinded_element: &BlindedElement<CS>,
) -> EvaluationElement<CS>
pub fn blind_evaluate( &self, blinded_element: &BlindedElement<CS>, ) -> EvaluationElement<CS>
Computes the second step for the multiplicative blinding version of DH-OPRF. This message is sent from the server (who holds the OPRF key) to the client.
Sourcepub fn evaluate(
&self,
input: &[u8],
) -> Result<Output<<CS as CipherSuite>::Hash>>
pub fn evaluate( &self, input: &[u8], ) -> Result<Output<<CS as CipherSuite>::Hash>>
Computes the output of the OPRF on the server side
§Errors
Error::Input if the input is longer then u16::MAX.
Source§impl<CS: CipherSuite> OprfServer<CS>
impl<CS: CipherSuite> OprfServer<CS>
Sourcepub fn serialize(&self) -> Array<u8, OprfServerLen<CS>>
pub fn serialize(&self) -> Array<u8, OprfServerLen<CS>>
Serialization into bytes