pub struct Poly1305 { /* private fields */ }
Expand description
Define the Poly1305 struct for the Poly1305 MAC algorithm.
Implementations§
Trait Implementations§
Source§impl AlgorithmKeyInit for Poly1305
impl AlgorithmKeyInit for Poly1305
Source§fn init(&mut self, key: &[u8])
fn init(&mut self, key: &[u8])
Initializes the Poly1305 state with the given key.
This method sets up the Poly1305 state using a 32-byte key. The key is split
into two parts: the r
array (for the algorithm’s internal state) and the pad
(used in the final computation steps).
§Arguments
key
- A byte slice containing the 32-byte key._iv
- An optional Initialization Vector, not used in Poly1305.
§Returns
A mutable reference to the initialized Poly1305 instance.
§Notes
The Initialization Vector (_iv
) is not used in Poly1305 and can be passed as an empty slice.
Source§impl AlgorithmProcess for Poly1305
impl AlgorithmProcess for Poly1305
Source§fn process(&mut self, data: &[u8]) -> Vec<u8> ⓘ
fn process(&mut self, data: &[u8]) -> Vec<u8> ⓘ
Processes the given data and computes the MAC.
This method processes the input data in 16-byte blocks to compute the message authentication code (MAC). If the data does not divide evenly into 16-byte blocks, the final block is padded as necessary.
§Arguments
data
- A byte slice representing the data to be processed.
§Returns
A vector of bytes (Vec<u8>
) containing the computed MAC.
impl AEADAlgorithm for Poly1305
Auto Trait Implementations§
impl Freeze for Poly1305
impl RefUnwindSafe for Poly1305
impl Send for Poly1305
impl Sync for Poly1305
impl Unpin for Poly1305
impl UnwindSafe for Poly1305
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more