1 #ifndef _BFLB_SEC_AES_H 2 #define _BFLB_SEC_AES_H 17 #define AES_MODE_ECB 0 18 #define AES_MODE_CTR 1 19 #define AES_MODE_CBC 2 20 #define AES_MODE_XTS 3 28 #define AES_LINK_KEY_128BITS 0 29 #define AES_LINK_KEY_192BITS 2 30 #define AES_LINK_KEY_256BITS 1 31 #define AES_LINK_KEY_DOUBLE_128BITS 3 36 #define AES_LINK_XTS_MODE1 0 37 #define AES_LINK_XTS_MODE2 1 170 const uint8_t *input,
186 const uint8_t *input,
217 const uint8_t *input,
void bflb_group0_request_aes_access(struct bflb_device_s *dev)
Enable aes in group0.
void bflb_aes_init(struct bflb_device_s *dev)
Enable aes.
void bflb_aes_link_init(struct bflb_device_s *dev)
Enable aes link mode.
struct bflb_aes_link_s __attribute__((aligned(4)))
void bflb_aes_set_mode(struct bflb_device_s *dev, uint8_t mode)
Set aes mode.
void bflb_aes_link_deinit(struct bflb_device_s *dev)
Disable aes link mode.
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.
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.
void bflb_group0_release_aes_access(struct bflb_device_s *dev)
Disable aes in group0.
void bflb_aes_set_hwkey_source(struct bflb_device_s *dev, uint8_t source)
Set aes hardware key source.
void bflb_aes_set_hwkey(uint8_t keysel)
Set aes hardware key.
void bflb_aes_setkey(struct bflb_device_s *dev, const uint8_t *key, uint16_t keybits)
Set aes key.
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.
void bflb_aes_deinit(struct bflb_device_s *dev)
Disable aes.