pub(crate) struct Aes256CbcHmacSha256;Expand description
The legacy AES-256-CBC-HMAC-SHA256 Encrypt-then-MAC cipher. The 64-byte composite key is the AES-256-CBC encryption sub-key (first 32 bytes) followed by the HMAC-SHA256 authentication sub-key (last 32 bytes).
Implementations§
Source§impl Aes256CbcHmacSha256
impl Aes256CbcHmacSha256
Sourcepub(crate) fn encrypt(
iv: &[u8; 16],
plaintext: &[u8],
key: &[u8; 64],
) -> ([u8; 32], Vec<u8>)
pub(crate) fn encrypt( iv: &[u8; 16], plaintext: &[u8], key: &[u8; 64], ) -> ([u8; 32], Vec<u8>)
Encrypt using AES-256 in CBC mode, returning the MAC over the IV and ciphertext along with the ciphertext.
A fresh, cryptographically random IV must be supplied for every message encrypted under a given key; generating it is the caller’s responsibility.
Auto Trait Implementations§
impl Freeze for Aes256CbcHmacSha256
impl RefUnwindSafe for Aes256CbcHmacSha256
impl Send for Aes256CbcHmacSha256
impl Sync for Aes256CbcHmacSha256
impl Unpin for Aes256CbcHmacSha256
impl UnsafeUnpin for Aes256CbcHmacSha256
impl UnwindSafe for Aes256CbcHmacSha256
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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