#[repr(C)]
pub struct Token { pub(crate) t: TokenPreimage, r: Scalar, }
Expand description

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

Implementations

Generates a new random Token using the provided random number generator.

Creates a new Token, using hashing to derive a TokenPreimage and the specified blind

Creates a new Token, using hashing to derive a TokenPreimage and a random blind

Blinds the Token, returning a BlindedToken to be sent to the server.

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.

Convert this Token to a byte array.

Construct a Token from a slice of bytes.

Trait Implementations

Formats the value using the given formatter. Read more

Overwrite the token blinding factor with null when it goes out of scope.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.