pub struct OprfClient<CS: CipherSuite>where
<CS::Hash as OutputSizeUser>::OutputSize: IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,{ /* private fields */ }Expand description
A client which engages with a OprfServer in base mode, meaning that the OPRF outputs are not verifiable.
Implementations§
Source§impl<CS: CipherSuite> OprfClient<CS>where
<CS::Hash as OutputSizeUser>::OutputSize: IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
impl<CS: CipherSuite> OprfClient<CS>where
<CS::Hash as OutputSizeUser>::OutputSize: IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
Sourcepub fn blind<R: RngCore + CryptoRng>(
input: &[u8],
blinding_factor_rng: &mut R,
) -> Result<OprfClientBlindResult<CS>>
pub fn blind<R: RngCore + CryptoRng>( input: &[u8], blinding_factor_rng: &mut R, ) -> Result<OprfClientBlindResult<CS>>
Computes the first step for the multiplicative blinding version of DH-OPRF.
§Errors
Error::Input if the input is empty or longer then u16::MAX.
Sourcepub fn deterministic_blind_unchecked(
input: &[u8],
blind: <CS::Group as Group>::Scalar,
) -> Result<OprfClientBlindResult<CS>>
Available on crate feature danger only.
pub fn deterministic_blind_unchecked( input: &[u8], blind: <CS::Group as Group>::Scalar, ) -> Result<OprfClientBlindResult<CS>>
danger only.Computes the first step for the multiplicative blinding version of DH-OPRF, taking a blinding factor scalar as input instead of sampling from an RNG.
§Caution
This should be used with caution, since it does not perform any checks on the validity of the blinding factor!
§Errors
Error::Input if the input is empty or longer then u16::MAX.
Sourcepub fn finalize(
&self,
input: &[u8],
evaluation_element: &EvaluationElement<CS>,
) -> Result<Output<CS::Hash>>
pub fn finalize( &self, input: &[u8], evaluation_element: &EvaluationElement<CS>, ) -> Result<Output<CS::Hash>>
Computes the third step for the multiplicative blinding version of DH-OPRF, in which the client unblinds the server’s message.
§Errors
Error::Input if the input is empty or longer then u16::MAX.
Source§impl<CS: CipherSuite> OprfClient<CS>where
<CS::Hash as OutputSizeUser>::OutputSize: IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
impl<CS: CipherSuite> OprfClient<CS>where
<CS::Hash as OutputSizeUser>::OutputSize: IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
Sourcepub fn serialize(&self) -> GenericArray<u8, OprfClientLen<CS>>
pub fn serialize(&self) -> GenericArray<u8, OprfClientLen<CS>>
Serialization into bytes