pub struct SFrameEncryptor { /* private fields */ }Expand description
Stateful per-sender SFrame encryptor.
Holds the derived key+salt for one (epoch, leaf_index) pair and an
internal counter that increments on every call to [encrypt].
Obtain via crate::SFrameSession::encryptor.
Implementations§
Source§impl SFrameEncryptor
impl SFrameEncryptor
Sourcepub fn encrypt(
&mut self,
plaintext: &[u8],
extra_aad: &[u8],
) -> Result<Vec<u8>, SFrameError>
pub fn encrypt( &mut self, plaintext: &[u8], extra_aad: &[u8], ) -> Result<Vec<u8>, SFrameError>
Encrypts plaintext and returns the complete SFrame payload:
header ‖ ciphertext ‖ GCM-tag.
extra_aad is appended to the SFrame header to form the full AAD
(e.g. pass an RTP header or an empty slice).
Auto Trait Implementations§
impl Freeze for SFrameEncryptor
impl RefUnwindSafe for SFrameEncryptor
impl Send for SFrameEncryptor
impl Sync for SFrameEncryptor
impl Unpin for SFrameEncryptor
impl UnsafeUnpin for SFrameEncryptor
impl UnwindSafe for SFrameEncryptor
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> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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