pub struct Aes256(/* private fields */);Expand description
A key-scheduled Aes256 block cipher which can both encrypt and decrypt blocks.
Trait Implementations§
Source§impl AesBlockCipher for Aes256
impl AesBlockCipher for Aes256
Source§fn new_with_key(key: Self::Key) -> Self
fn new_with_key(key: Self::Key) -> Self
Schedule a new AES key.
§Scalar Equivalent
ⓘ
Self({
<aes::Aes256 as aes::cipher::KeyInit>::new_from_slice(key.as_ref())
.expect("AES size is statically correct")
})§AVX2 Intrinsics Used
_mm_aesimc_si128AESIMC xmm, xmm
_mm_aeskeygenassist_si128AESKEYGENASSIST xmm, xmm, imm8
§Neon Intrinsics Used
vaeseq_u8- This intrinsic compiles to the following instructions:
vaesimcq_u8- This intrinsic compiles to the following instructions:
Source§fn encrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]where
ArrayUnrolledOps: UnrollableArraySize<N>,
fn encrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]where
ArrayUnrolledOps: UnrollableArraySize<N>,
Encrypt blocks with AES-ECB
§Scalar Equivalent
ⓘ
let mut out = blocks;
for block in out.iter_mut() {
let block = aes::cipher::generic_array::GenericArray::from_mut_slice(
block.as_mut(),
);
aes::cipher::BlockEncrypt::encrypt_block((&self.0), block);
}
out§AVX2 Intrinsics Used
_mm_aesenc_si128AESENC xmm, xmm
_mm_aesenclast_si128AESENCLAST xmm, xmm
§Neon Intrinsics Used
vaeseq_u8- This intrinsic compiles to the following instructions:
vaesmcq_u8- This intrinsic compiles to the following instructions:
Source§const BLOCK_COUNT_HINT: usize = 4
const BLOCK_COUNT_HINT: usize = 4
Running
encrypt_many with this many blocks will typically result in good
performance.Source§impl AesBlockCipherDecrypt for Aes256
impl AesBlockCipherDecrypt for Aes256
Source§fn decrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]where
ArrayUnrolledOps: UnrollableArraySize<N>,
fn decrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]where
ArrayUnrolledOps: UnrollableArraySize<N>,
Decrypt blocks with AES-ECB
§Scalar Equivalent
ⓘ
let mut out = blocks;
for block in out.iter_mut() {
let block = aes::cipher::generic_array::GenericArray::from_mut_slice(
block.as_mut(),
);
aes::cipher::BlockDecrypt::decrypt_block((&self.0), block);
}
out§AVX2 Intrinsics Used
_mm_aesdec_si128AESDEC xmm, xmm
_mm_aesdeclast_si128AESDECLAST xmm, xmm
§Neon Intrinsics Used
vaesdq_u8- This intrinsic compiles to the following instructions:
vaesimcq_u8- This intrinsic compiles to the following instructions:
Auto Trait Implementations§
impl Freeze for Aes256
impl RefUnwindSafe for Aes256
impl Send for Aes256
impl Sync for Aes256
impl Unpin for Aes256
impl UnsafeUnpin for Aes256
impl UnwindSafe for Aes256
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