Struct nrf5x::aes::AesECB
[−]
[src]
pub struct AesECB<'a> { regs: *const AESECB_REGS, client: Cell<Option<&'a Client<'a>>>, input: TakeCell<'a, [u8]>, output: TakeCell<'a, [u8]>, keystream: Cell<[u8; 128]>, current_idx: Cell<usize>, start_idx: Cell<usize>, end_idx: Cell<usize>, }
Fields
regs: *const AESECB_REGS
client: Cell<Option<&'a Client<'a>>>
input: TakeCell<'a, [u8]>
Input either plaintext or ciphertext to be encrypted or decrypted.
output: TakeCell<'a, [u8]>
keystream: Cell<[u8; 128]>
Keystream to be XOR'ed with the input.
current_idx: Cell<usize>
start_idx: Cell<usize>
end_idx: Cell<usize>
Methods
impl<'a> AesECB<'a>
[src]
const fn new() -> AesECB<'a>
[src]
fn init_dma(&self)
[src]
fn update_ctr(&self)
[src]
fn crypt(&self)
[src]
pub fn handle_interrupt(&self)
[src]
fn enable_interrupts(&self)
[src]
fn disable_interrupts(&self)
[src]
Trait Implementations
impl<'a> AES128<'a> for AesECB<'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 AesECB<'a>
[src]
fn set_mode_aes128ctr(&self, _encrypting: bool)
[src]
Call before AES128::crypt()
to perform AES128Ctr