pub struct Poly1305 { /* private fields */ }
Expand description
Poly1305 streaming state.
Implementations§
source§impl Poly1305
impl Poly1305
sourcepub fn new(one_time_key: &OneTimeKey) -> Self
pub fn new(one_time_key: &OneTimeKey) -> Self
Initialize a Poly1305
struct with a given one-time key.
sourcepub fn update(&mut self, data: &[u8]) -> Result<(), UnknownCryptoError>
pub fn update(&mut self, data: &[u8]) -> Result<(), UnknownCryptoError>
Update state with data
. This can be called multiple times.
sourcepub fn finalize(&mut self) -> Result<Tag, UnknownCryptoError>
pub fn finalize(&mut self) -> Result<Tag, UnknownCryptoError>
Return a Poly1305 tag.
sourcepub fn poly1305(
one_time_key: &OneTimeKey,
data: &[u8]
) -> Result<Tag, UnknownCryptoError>
pub fn poly1305( one_time_key: &OneTimeKey, data: &[u8] ) -> Result<Tag, UnknownCryptoError>
One-shot function for generating a Poly1305 tag of data
.
sourcepub fn verify(
expected: &Tag,
one_time_key: &OneTimeKey,
data: &[u8]
) -> Result<(), UnknownCryptoError>
pub fn verify( expected: &Tag, one_time_key: &OneTimeKey, data: &[u8] ) -> Result<(), UnknownCryptoError>
Verify a Poly1305 tag in constant time.
Trait Implementations§
Auto Trait Implementations§
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