pub struct StreamPoly1305Aead { /* private fields */ }Available on crate feature
allow-non-fips only.Expand description
Represents an ongoing streaming MAC computation, allowing incremental updates.
This uses the TLS AEAD padding scheme.
§Example
use wolf_crypto::{mac::{Poly1305, poly1305::Key}, aead::Tag};
let key: Key = [42u8; 32].into();
let tag = Poly1305::new(key.as_ref())
.aead_padding()
.update(b"chunk1")?
.update(b"chunk2")?
.update(b"chunk3")?
.finalize();Implementations§
Source§impl StreamPoly1305Aead
impl StreamPoly1305Aead
Sourcepub fn update(self, input: &[u8]) -> Result<Self, Self>
pub fn update(self, input: &[u8]) -> Result<Self, Self>
Updates the streaming MAC computation with additional input.
§Arguments
input- A byte slice representing the additional data to include.
§Errors
- The length of the
inputwas greater thanu32::MAX. - The total length that has been processed is greater than
u32::MAX,
§Example
use wolf_crypto::{mac::{Poly1305, poly1305::Key}, aead::Tag};
let key: Key = [42u8; 32].into();
let tag = Poly1305::new(key.as_ref())
.aead_padding()
.update(b"chunk1")?
.update(b"chunk2")?
.update(b"chunk3")?
.finalize();Sourcepub fn finalize(self) -> Tag
pub fn finalize(self) -> Tag
Finalizes the streaming MAC computation and returns the resulting Tag.
§Returns
The associated authentication Tag.
§Example
use wolf_crypto::{mac::{Poly1305, poly1305::Key}, aead::Tag};
let key: Key = [42u8; 32].into();
let tag = Poly1305::new(key.as_ref())
.aead_padding()
.update(b"chunk1")?
.update(b"chunk2")?
.update(b"chunk3")?
.finalize();Trait Implementations§
Source§impl Debug for StreamPoly1305Aead
impl Debug for StreamPoly1305Aead
Source§impl From<StreamPoly1305Aead> for Unspecified
impl From<StreamPoly1305Aead> for Unspecified
Source§fn from(value: StreamPoly1305Aead) -> Self
fn from(value: StreamPoly1305Aead) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StreamPoly1305Aead
impl RefUnwindSafe for StreamPoly1305Aead
impl Send for StreamPoly1305Aead
impl Sync for StreamPoly1305Aead
impl Unpin for StreamPoly1305Aead
impl UnwindSafe for StreamPoly1305Aead
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