Trait kernel::hil::symmetric_encryption::AES128CCM

source ·
pub trait AES128CCM<'a> {
    // Required methods
    fn set_client(&'a self, client: &'a dyn CCMClient);
    fn set_key(&self, key: &[u8]) -> Result<(), ErrorCode>;
    fn set_nonce(&self, nonce: &[u8]) -> Result<(), ErrorCode>;
    fn crypt(
        &self,
        buf: &'static mut [u8],
        a_off: usize,
        m_off: usize,
        m_len: usize,
        mic_len: usize,
        confidential: bool,
        encrypting: bool,
    ) -> Result<(), (ErrorCode, &'static mut [u8])>;
}

Required Methods§

source

fn set_client(&'a self, client: &'a dyn CCMClient)

Set the client instance which will receive crypt_done() callbacks

source

fn set_key(&self, key: &[u8]) -> Result<(), ErrorCode>

Set the key to be used for CCM encryption

source

fn set_nonce(&self, nonce: &[u8]) -> Result<(), ErrorCode>

Set the nonce (length NONCE_LENGTH) to be used for CCM encryption

source

fn crypt( &self, buf: &'static mut [u8], a_off: usize, m_off: usize, m_len: usize, mic_len: usize, confidential: bool, encrypting: bool, ) -> Result<(), (ErrorCode, &'static mut [u8])>

Try to begin the encryption/decryption process

Implementors§