|
Bouffalo SDK
1.0
Bouffalolab Software Development Kit
|
|
Modules | |
| aes mode definition | |
| aes link mode keybits definition | |
Data Structures | |
| struct | bflb_aes_link_s |
| struct | bflb_aes_xts_link_s |
Macros | |
| #define | AES_LINK_XTS_MODE1 0 |
| #define | AES_LINK_XTS_MODE2 1 |
Functions | |
| struct bflb_aes_link_s | __attribute__ ((aligned(4))) |
| void | bflb_aes_init (struct bflb_device_s *dev) |
| Enable aes. More... | |
| void | bflb_aes_deinit (struct bflb_device_s *dev) |
| Disable aes. More... | |
| void | bflb_aes_set_hwkey (uint8_t keysel) |
| Set aes hardware key. More... | |
| void | bflb_aes_set_hwkey_source (struct bflb_device_s *dev, uint8_t source) |
| Set aes hardware key source. More... | |
| void | bflb_aes_set_mode (struct bflb_device_s *dev, uint8_t mode) |
| Set aes mode. More... | |
| void | bflb_aes_setkey (struct bflb_device_s *dev, const uint8_t *key, uint16_t keybits) |
| Set aes key. More... | |
| int | bflb_aes_encrypt (struct bflb_device_s *dev, const uint8_t *input, const uint8_t *iv, uint8_t *output, uint32_t len) |
| Perform aes encrypt. More... | |
| int | bflb_aes_decrypt (struct bflb_device_s *dev, const uint8_t *input, const uint8_t *iv, uint8_t *output, uint32_t len) |
| Perform aes decrypt. More... | |
| void | bflb_aes_link_init (struct bflb_device_s *dev) |
| Enable aes link mode. More... | |
| void | bflb_aes_link_deinit (struct bflb_device_s *dev) |
| Disable aes link mode. More... | |
| int | bflb_aes_link_update (struct bflb_device_s *dev, uint32_t link_addr, const uint8_t *input, uint8_t *output, uint32_t len) |
| Perform encrypt or decrypt with link mode. More... | |
| void | bflb_group0_request_aes_access (struct bflb_device_s *dev) |
| Enable aes in group0. More... | |
| void | bflb_group0_release_aes_access (struct bflb_device_s *dev) |
| Disable aes in group0. More... | |
| #define AES_LINK_XTS_MODE1 0 |
Definition at line 36 of file bflb_sec_aes.h.
| #define AES_LINK_XTS_MODE2 1 |
Definition at line 37 of file bflb_sec_aes.h.
| struct bflb_aes_link_s __attribute__ | ( | (aligned(4)) | ) |
| int bflb_aes_decrypt | ( | struct bflb_device_s * | dev, |
| const uint8_t * | input, | ||
| const uint8_t * | iv, | ||
| uint8_t * | output, | ||
| uint32_t | len | ||
| ) |
Perform aes decrypt.
| [in] | dev | device handle |
| [in] | input | pointer to ciphertext |
| [in] | iv | input iv, if NULL, means use last iv. |
| [in] | output | pointer to plaintext |
| [in] | len | decrypt length, muse be multiple of 16 |
| void bflb_aes_deinit | ( | struct bflb_device_s * | dev | ) |
Disable aes.
| [in] | dev |
| int bflb_aes_encrypt | ( | struct bflb_device_s * | dev, |
| const uint8_t * | input, | ||
| const uint8_t * | iv, | ||
| uint8_t * | output, | ||
| uint32_t | len | ||
| ) |
Perform aes encrypt.
| [in] | dev | device handle |
| [in] | input | pointer to plaintext |
| [in] | iv | input iv, if NULL, means use last iv. |
| [in] | output | pointer to ciphertext |
| [in] | len | encrypt length, muse be multiple of 16 |
| void bflb_aes_init | ( | struct bflb_device_s * | dev | ) |
Enable aes.
| [in] | dev |
| void bflb_aes_link_deinit | ( | struct bflb_device_s * | dev | ) |
Disable aes link mode.
| [in] | dev | device handle |
| void bflb_aes_link_init | ( | struct bflb_device_s * | dev | ) |
Enable aes link mode.
| [in] | dev | device handle |
| int bflb_aes_link_update | ( | struct bflb_device_s * | dev, |
| uint32_t | link_addr, | ||
| const uint8_t * | input, | ||
| uint8_t * | output, | ||
| uint32_t | len | ||
| ) |
Perform encrypt or decrypt with link mode.
| [in] | dev | device handle |
| [in] | link_addr | link struct pointer address, must be located in 0x2xxxxxxx |
| [in] | input | pointer to plaintext or ciphertext |
| [in] | output | pointer to plaintext or ciphertext |
| [in] | len | update length, muse be multiple of 16 |
| void bflb_aes_set_hwkey | ( | uint8_t | keysel | ) |
Set aes hardware key.
| [in] | keysel | hardware key mode in efuse table |
| void bflb_aes_set_hwkey_source | ( | struct bflb_device_s * | dev, |
| uint8_t | source | ||
| ) |
Set aes hardware key source.
| [in] | dev | device handle |
| [in] | source | hardware key source |
| void bflb_aes_set_mode | ( | struct bflb_device_s * | dev, |
| uint8_t | mode | ||
| ) |
Set aes mode.
| [in] | dev | device handle |
| [in] | mode | aes mode, use aes mode definition |
| void bflb_aes_setkey | ( | struct bflb_device_s * | dev, |
| const uint8_t * | key, | ||
| uint16_t | keybits | ||
| ) |
Set aes key.
| [in] | dev | device handle |
| [in] | key | pointer to aes key, if NULL, means use hardware key |
| [in] | keybits | aes keybits, can be 128/192/256 |
| void bflb_group0_release_aes_access | ( | struct bflb_device_s * | dev | ) |
Disable aes in group0.
| [in] | dev | device handle |
| void bflb_group0_request_aes_access | ( | struct bflb_device_s * | dev | ) |
Enable aes in group0.
| [in] | dev | device handle |