23#ifndef AT86RF2XX_AES_H
24#define AT86RF2XX_AES_H
35#define AT86RF2XX_AES_KEY_BITS (128U)
39#define AT86RF2XX_AES_KEY_LENGTH ((AT86RF2XX_AES_KEY_BITS) / 8)
43#define AT86RF2XX_AES_BLOCK_SIZE ((AT86RF2XX_AES_KEY_BITS) / 8)
47#define AT86RF2XX_AES_DELAY_US (24)
53#define AT86RF2XX_REG__AES_STATUS (0x82)
54#define AT86RF2XX_REG__AES_CTRL (0x83)
55#define AT86RF2XX_REG__AES_KEY_START (0x84)
56#define AT86RF2XX_REG__AES_KEY_END (0x93)
57#define AT86RF2XX_REG__AES_DATA_START (0x84)
58#define AT86RF2XX_REG__AES_DATA_END (0x93)
59#define AT86RF2XX_REG__AES_CTRL_MIRROR (0x94)
66#define AT86RF2XX_AES_STATUS_MASK__AES_ER (0x80)
67#define AT86RF2XX_AES_STATUS_MASK__AES_DONE (0x01)
69#define AT86RF2XX_AES_STATUS_AES_ER__NO_ERROR (0x00)
70#define AT86RF2XX_AES_STATUS_AES_ER__ERROR (0x80)
72#define AT86RF2XX_AES_STATUS_AES_DONE__NOT_DONE (0x00)
73#define AT86RF2XX_AES_STATUS_AES_DONE__DONE (0x01)
80#define AT86RF2XX_AES_CTRL_MASK__AES_REQUEST (0x80)
81#define AT86RF2XX_AES_CTRL_MASK__AES_MODE (0x70)
82#define AT86RF2XX_AES_CTRL_MASK__AES_DIR (0x08)
84#define AT86RF2XX_AES_CTRL_AES_REQUEST__IDLE (0x00)
85#define AT86RF2XX_AES_CTRL_AES_REQUEST__START (0x80)
87#define AT86RF2XX_AES_CTRL_AES_MODE__ECB (0x00)
88#define AT86RF2XX_AES_CTRL_AES_MODE__KEY (0x10)
89#define AT86RF2XX_AES_CTRL_AES_MODE__CBC (0x20)
91#define AT86RF2XX_AES_CTRL_AES_DIR__ENC (0x00)
92#define AT86RF2XX_AES_CTRL_AES_DIR__DEC (0x08)
99#define AT86RF2XX_AES_CTRL_MIRROR_MASK__AES_REQUEST (0x80)
100#define AT86RF2XX_AES_CTRL_MIRROR_MASK__AES_MODE (0x70)
101#define AT86RF2XX_AES_CTRL_MIRROR_MASK__AES_DIR (0x08)
103#define AT86RF2XX_AES_CTRL_MIRROR_AES_REQUEST__IDLE (0x00)
104#define AT86RF2XX_AES_CTRL_MIRROR_AES_REQUEST__START (0x80)
106#define AT86RF2XX_AES_CTRL_MIRROR_AES_MODE__ECB (0x00)
107#define AT86RF2XX_AES_CTRL_MIRROR_AES_MODE__KEY (0x10)
108#define AT86RF2XX_AES_CTRL_MIRROR_AES_MODE__CBC (0x20)
110#define AT86RF2XX_AES_CTRL_MIRROR_AES_DIR__ENC (0x00)
111#define AT86RF2XX_AES_CTRL_MIRROR_AES_DIR__DEC (0x08)
Interface definition for AT86RF2xx based drivers.
void at86rf2xx_aes_key_write_encrypt(at86rf2xx_t *dev, const uint8_t key[AT86RF2XX_AES_KEY_LENGTH])
Write the AES key used for encryption.
uint8_t aes_block_t[AT86RF2XX_AES_BLOCK_SIZE]
An AES block.
void at86rf2xx_aes_key_read_encrypt(at86rf2xx_t *dev, uint8_t key[AT86RF2XX_AES_KEY_LENGTH])
Read the AES key used for encryption.
void at86rf2xx_aes_key_read_decrypt(at86rf2xx_t *dev, uint8_t key[AT86RF2XX_AES_KEY_LENGTH])
Read the AES key used for decryption.
void at86rf2xx_aes_ecb_decrypt(at86rf2xx_t *dev, aes_block_t *plain, uint8_t key[AT86RF2XX_AES_BLOCK_SIZE], const aes_block_t *cipher, uint8_t nblocks)
Perform AES algorithm and decrypt data blocks in cipher to plain data blocks, using ECB mode.
void at86rf2xx_aes_key_write_decrypt(at86rf2xx_t *dev, const uint8_t key[AT86RF2XX_AES_KEY_LENGTH])
Write the AES key used for decryption.
void at86rf2xx_aes_cbc_encrypt(at86rf2xx_t *dev, aes_block_t *cipher, uint8_t key[AT86RF2XX_AES_BLOCK_SIZE], uint8_t iv[AT86RF2XX_AES_BLOCK_SIZE], const aes_block_t *plain, uint8_t nblocks)
Perform AES algorithm and encrypt data blocks in plain to cipher data blocks, using CBC mode.
#define AT86RF2XX_AES_BLOCK_SIZE
AES block size in bytes.
void at86rf2xx_aes_cbc_decrypt(at86rf2xx_t *dev, aes_block_t *plain, uint8_t key[AT86RF2XX_AES_BLOCK_SIZE], uint8_t iv[AT86RF2XX_AES_BLOCK_SIZE], const aes_block_t *cipher, uint8_t nblocks)
Perform AES algorithm and decrypt data blocks in cipher to plain data blocks, using CBC mode.
#define AT86RF2XX_AES_KEY_LENGTH
AES key length in bytes.
void at86rf2xx_aes_ecb_encrypt(at86rf2xx_t *dev, aes_block_t *cipher, uint8_t key[AT86RF2XX_AES_BLOCK_SIZE], const aes_block_t *plain, uint8_t nblocks)
Perform AES algorithm and encrypt data blocks in plain to cipher data blocks, using ECB mode.
Device descriptor for AT86RF2XX radio devices.