Trait vectoreyes::AesBlockCipher
source · [−]pub trait AesBlockCipher: 'static + Clone + Sync + Send {
type Key: 'static + Clone + Sync + Send;
type EncryptOnly: AesBlockCipher<Key = Self::Key> + From<Self>;
const FIXED_KEY: Self;
const BLOCK_COUNT_HINT: usize;
fn new_with_key(key: Self::Key) -> Self;
fn encrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]
where
ArrayUnrolledOps: UnrollableArraySize<N>;
fn encrypt(&self, block: U8x16) -> U8x16 { ... }
}
Required Associated Types
sourcetype EncryptOnly: AesBlockCipher<Key = Self::Key> + From<Self>
type EncryptOnly: AesBlockCipher<Key = Self::Key> + From<Self>
If you don’t need to use Aes for decryption, it’s faster to only perform key scheduling for encryption than for both encryption and decryption.
Required Associated Constants
sourceconst BLOCK_COUNT_HINT: usize
const BLOCK_COUNT_HINT: usize
Running encrypt_many
with this many blocks will result in the best performance.
When using hardware AES instructions, if the AES encrypt instructions all have a throughput of 1, then this constant will be equal to the instruction latency.
Required Methods
sourcefn new_with_key(key: Self::Key) -> Self
fn new_with_key(key: Self::Key) -> Self
If you need to AES with a particular key, be careful about endianness issues.
sourcefn encrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]where