pub struct StreamEncoder { /* private fields */ }Expand description
Incremental encoder that accumulates plaintext via update
and produces a single KkPacket on finalize.
The entropy snapshot is captured once at construction and reused for the entire stream. This avoids capturing a new snapshot per chunk while still binding every byte to the same unrepeatable moment.
§Example
use kk_crypto::StreamEncoder;
let secret = b"our-shared-secret";
let mut enc = StreamEncoder::new(secret).unwrap();
enc.update(b"Hello ");
enc.update(b"KK!");
let packet = enc.finalize().unwrap();Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamEncoder
impl RefUnwindSafe for StreamEncoder
impl Send for StreamEncoder
impl Sync for StreamEncoder
impl Unpin for StreamEncoder
impl UnsafeUnpin for StreamEncoder
impl UnwindSafe for StreamEncoder
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> 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