Struct Poly1305
pub struct Poly1305 { /* private fields */ }
Expand description
The Poly1305 universal hash function.
Note that Poly1305 is not a traditional MAC and is single-use only (a.k.a. “one-time authenticator”).
For this reason it doesn’t impl the crypto_mac::Mac
trait.
Implementations§
§impl Poly1305
impl Poly1305
pub fn compute_unpadded(
self,
data: &[u8],
) -> GenericArray<u8, <Poly1305 as BlockSizeUser>::BlockSize>
pub fn compute_unpadded( self, data: &[u8], ) -> GenericArray<u8, <Poly1305 as BlockSizeUser>::BlockSize>
Compute unpadded Poly1305 for the given input data.
The main use case for this is XSalsa20Poly1305.
Trait Implementations§
§impl BlockSizeUser for Poly1305
impl BlockSizeUser for Poly1305
§impl KeyInit for Poly1305
impl KeyInit for Poly1305
§impl KeySizeUser for Poly1305
impl KeySizeUser for Poly1305
§impl UniversalHash for Poly1305
impl UniversalHash for Poly1305
§fn update_with_backend(
&mut self,
f: impl UhfClosure<BlockSize = <Poly1305 as BlockSizeUser>::BlockSize>,
)
fn update_with_backend( &mut self, f: impl UhfClosure<BlockSize = <Poly1305 as BlockSizeUser>::BlockSize>, )
Update hash function state using the provided rank-2 closure.
§fn update(&mut self, blocks: &[GenericArray<u8, Self::BlockSize>])
fn update(&mut self, blocks: &[GenericArray<u8, Self::BlockSize>])
Update hash function state with the provided block.
§fn update_padded(&mut self, data: &[u8])
fn update_padded(&mut self, data: &[u8])
Input data into the universal hash function. If the length of the
data is not a multiple of the block size, the remaining data is
padded with zeroes up to the
BlockSize
. Read more§fn finalize_reset(&mut self) -> GenericArray<u8, Self::BlockSize>where
Self: Clone + Reset,
fn finalize_reset(&mut self) -> GenericArray<u8, Self::BlockSize>where
Self: Clone + Reset,
Obtain the [
Output
] of a UniversalHash
computation and reset it back
to its initial state.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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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