pub trait Encrypt {
// Required method
fn encrypt(
&mut self,
key_stream_buf: &mut [u8; 16],
a_block: &mut [u8; 16],
key: [u8; 16],
);
}Expand description
A HAL trait to allow different MCUs with AES hardware acceleration to hook onto the AES-CCM implementation.
§Example
Example usage with the esp_hal crate (compatible with ~1.1.0):
ⓘ
use aesccm::Encrypt;
impl Encrypt for esp_hal::aes::Aes<'static> {
fn encrypt(
&mut self,
key_stream_buf: &mut [u8; 16],
a_block: &mut [u8; 16],
key: [u8; 16],
) {
key_stream_buf.copy_from_slice(a_block);
self.encrypt(key_stream_buf, key);
}
}Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".