Struct sam4l::aes::Aes
[−]
[src]
pub struct Aes<'a> { registers: *const AesRegisters, client: Cell<Option<&'a Client<'a>>>, source: TakeCell<'a, [u8]>, dest: TakeCell<'a, [u8]>, write_index: Cell<usize>, read_index: Cell<usize>, stop_index: Cell<usize>, }
Fields
registers: *const AesRegisters
client: Cell<Option<&'a Client<'a>>>
source: TakeCell<'a, [u8]>
dest: TakeCell<'a, [u8]>
write_index: Cell<usize>
read_index: Cell<usize>
stop_index: Cell<usize>
Methods
impl<'a> Aes<'a>
[src]
pub const fn new() -> Aes<'a>
[src]
fn enable_clock(&self)
[src]
fn disable_clock(&self)
[src]
fn enable_interrupts(&self)
[src]
fn disable_interrupts(&self)
[src]
fn disable_input_interrupt(&self)
[src]
fn busy(&self) -> bool
[src]
fn set_mode(&self, encrypting: bool, mode: ConfidentialityMode)
[src]
fn input_buffer_ready(&self) -> bool
[src]
fn output_data_ready(&self) -> bool
[src]
fn try_set_indices(&self, start_index: usize, stop_index: usize) -> bool
[src]
fn write_block(&self) -> bool
[src]
fn read_block(&self) -> bool
[src]
pub fn handle_interrupt(&self)
[src]
Handle an interrupt, which will indicate either that the AESA's input buffer is ready for more data, or that it has completed a block of output for us to consume
Trait Implementations
impl<'a> AES128<'a> for Aes<'a>
[src]
fn enable(&self)
[src]
Enable the AES hardware. Must be called before any other methods Read more
fn disable(&self)
[src]
Disable the AES hardware
fn set_client(&'a self, client: &'a Client<'a>)
[src]
Set the client instance which will receive crypt_done()
callbacks
fn set_key(&self, key: &[u8]) -> ReturnCode
[src]
Set the encryption key. Returns EINVAL
if length is not AES128_KEY_SIZE
Read more
fn set_iv(&self, iv: &[u8]) -> ReturnCode
[src]
Set the IV (or initial counter). Returns EINVAL
if length is not AES128_BLOCK_SIZE
Read more
fn start_message(&self)
[src]
Begin a new message (with the configured IV) when crypt()
is next called. Multiple calls to crypt()
may be made between calls to start_message()
, allowing the encryption context to extend over non-contiguous extents of data. Read more
fn crypt(
&'a self,
source: Option<&'a mut [u8]>,
dest: &'a mut [u8],
start_index: usize,
stop_index: usize
) -> Option<(ReturnCode, Option<&'a mut [u8]>, &'a mut [u8])>
[src]
&'a self,
source: Option<&'a mut [u8]>,
dest: &'a mut [u8],
start_index: usize,
stop_index: usize
) -> Option<(ReturnCode, Option<&'a mut [u8]>, &'a mut [u8])>
Request an encryption/decryption Read more
impl<'a> AES128Ctr for Aes<'a>
[src]
fn set_mode_aes128ctr(&self, encrypting: bool)
[src]
Call before AES128::crypt()
to perform AES128Ctr
impl<'a> AES128CBC for Aes<'a>
[src]
fn set_mode_aes128cbc(&self, encrypting: bool)
[src]
Call before AES128::crypt()
to perform AES128CBC