pub struct OnetimeAuth { /* private fields */ }
Expand description

One-time authentication implementation based on Poly1305, compatible with libsodium’s crypto_onetimeauth_* functions.

Implementations

Single-part interface for OnetimeAuth. Computes (and returns) the message authentication code for input using key. The key is consumed to prevent accidental re-use of the same key.

Convience wrapper around OnetimeAuth::compute. Returns the message authentication code as a Vec. The key is consumed to prevent accidental re-use of the same key.

Verifies the message authentication code other_mac matches the expected code for key and input. The key is consumed to prevent accidental re-use of the same key.

Returns a new one-time authenticator for key. The key is consumed to prevent accidental re-use of the same key.

Updates the one-time authenticator at self with input.

Finalizes this one-time authenticator, returning the message authentication code.

Finalizes this one-time authenticator, returning the message authentication code as a Vec. Convenience wrapper around OnetimeAuth::finalize.

Finalizes this authenticator, and verifies that the computed code matches other_mac using a constant-time comparison.

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.