pub struct SFrameEncryptor { /* private fields */ }Expand description
Stateful per-sender SFrame encryptor.
Holds the derived key for one (epoch, leaf_index) KID 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 bound into the AEAD tag (e.g. an RTP header) but is not
carried in the returned payload; the receiver supplies the same slice to
SFrameDecryptor::decrypt.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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