pub struct CipherState<Nonce = u64> {
    pub nonce: Nonce,
    /* private fields */
}

Fields

nonce: Nonce

Note that a nonce of u64::MAX will cause an error on every call to encrypt

Implementations

Encrypt, with a provided nonce (must prevent reuse). This occurs in place. The last TAG_SIZE bytes of buf will be replaced with the AEAD tag.

Returns the size of the encrypted message. Buf should have space for a tag

Returns the decrypted payload

Trait Implementations

Executes the destructor for this type. Read more
Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. 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.