[−][src]Struct challenge_bypass_ristretto::voprf::Token
A Token
consists of a randomly chosen preimage and blinding factor.
Since a token includes the blinding factor it should be treated as a client secret and NEVER revealed to the server.
Fields
t: TokenPreimage
t
is a TokenPreimage
r: Scalar
r
is a Scalar
which is the blinding factor
Methods
impl Token
[src]
pub fn random<D, T>(rng: &mut T) -> Self where
D: Digest<OutputSize = U64> + Default,
T: Rng + CryptoRng,
[src]
D: Digest<OutputSize = U64> + Default,
T: Rng + CryptoRng,
Generates a new random Token
using the provided random number generator.
pub(crate) fn hash_from_bytes_with_blind<D>(
bytes: &[u8],
blinding_scalar: Scalar
) -> Self where
D: Digest<OutputSize = U64> + Default,
[src]
bytes: &[u8],
blinding_scalar: Scalar
) -> Self where
D: Digest<OutputSize = U64> + Default,
Creates a new Token
, using hashing to derive a TokenPreimage
and the specified blind
pub fn hash_from_bytes<D, T>(rng: &mut T, bytes: &[u8]) -> Self where
D: Digest<OutputSize = U64> + Default,
T: Rng + CryptoRng,
[src]
D: Digest<OutputSize = U64> + Default,
T: Rng + CryptoRng,
Creates a new Token
, using hashing to derive a TokenPreimage
and a random blind
pub fn blind(&self) -> BlindedToken
[src]
Blinds the Token
, returning a BlindedToken
to be sent to the server.
pub(crate) fn unblind(
&self,
Q: &SignedToken
) -> Result<UnblindedToken, TokenError>
[src]
&self,
Q: &SignedToken
) -> Result<UnblindedToken, TokenError>
Using the blinding factor of the original Token
, unblind a SignedToken
returned from the server.
Returns a TokenError
if the SignedToken
point is not valid.
pub fn to_bytes(&self) -> [u8; 96]
[src]
Convert this Token
to a byte array.
fn bytes_length_error() -> TokenError
[src]
pub fn from_bytes(bytes: &[u8]) -> Result<Token, TokenError>
[src]
Construct a Token
from a slice of bytes.
Trait Implementations
impl Debug for Token
[src]
impl Drop for Token
[src]
Overwrite the token blinding factor with null when it goes out of scope.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self