[][src]Struct poly1305::Poly1305

pub struct Poly1305 { /* fields omitted */ }

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.

Methods

impl Poly1305[src]

pub fn new(key: &[u8; 32]) -> Poly1305[src]

Initialize Poly1305 with the given key

pub fn input(&mut self, data: &[u8])[src]

Input data into the Poly1305 universal hash function

pub fn input_padded(&mut self, data: &[u8])[src]

Input data into Poly1305, first padding it to Poly1305's block size ala the pad16() function described in RFC 8439 section 2.8.1: https://tools.ietf.org/html/rfc8439#section-2.8.1

This is primarily useful for implementing Salsa20 family authenticated encryption constructions.

pub fn chain(self, data: &[u8]) -> Self[src]

Process input messages in a chained manner

pub fn result(self) -> Tag[src]

Get the hashed output

Trait Implementations

impl Clone for Poly1305[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Unpin for Poly1305

impl Send for Poly1305

impl Sync for Poly1305

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self