MT7687 API Reference  LinkIt SDK v4
AES

This section introduces the AES driver APIs including terms and acronyms, supported features, software architecture details on how to use this driver, AES function groups, enums, structures and functions. More...

Overview

This section introduces the AES driver APIs including terms and acronyms, supported features, software architecture details on how to use this driver, AES function groups, enums, structures and functions.

Terms and acronyms

Terms Details
AES The Advanced Encryption Standard. For more information, please refer to introduction to the AES in Wikipedia.
CBC The Cipher Block Chaining(CBC), each block of plain text is XOR'ed with the previous cipher block before being encrypted. This way, each cipher text block depends on all plain text blocks processed up to that point.
ECB The simplest of the encryption mode is the Electronic Codebook (ECB) mode. The message is divided into blocks, and each block is encrypted separately.

Supported features

How to use this driver

Functions

hal_aes_status_t hal_aes_cbc_encrypt (hal_aes_buffer_t *encrypted_text, hal_aes_buffer_t *plain_text, hal_aes_buffer_t *key, uint8_t init_vector[HAL_AES_CBC_IV_LENGTH])
 This function provides an AES encryption in a CBC mode. More...
 
hal_aes_status_t hal_aes_cbc_decrypt (hal_aes_buffer_t *plain_text, hal_aes_buffer_t *encrypted_text, hal_aes_buffer_t *key, uint8_t init_vector[HAL_AES_CBC_IV_LENGTH])
 This function provides an AES decryption in a CBC mode. More...
 
hal_aes_status_t hal_aes_ecb_encrypt (hal_aes_buffer_t *encrypted_text, hal_aes_buffer_t *plain_text, hal_aes_buffer_t *key)
 This function provides an AES encryption in a EBC mode. More...
 
hal_aes_status_t hal_aes_ecb_decrypt (hal_aes_buffer_t *plain_text, hal_aes_buffer_t *encrypted_text, hal_aes_buffer_t *key)
 This function provides an AES decryption in a EBC mode. More...
 

Modules

 Define
 
 Enum
 
 Struct
 

Function Documentation

hal_aes_status_t hal_aes_cbc_decrypt ( hal_aes_buffer_t plain_text,
hal_aes_buffer_t encrypted_text,
hal_aes_buffer_t key,
uint8_t  init_vector[HAL_AES_CBC_IV_LENGTH] 
)

This function provides an AES decryption in a CBC mode.

Parameters
[out]plain_textis the target plain text.
[in]encrypted_textis the source encrypted text.
[in]keyis the AES encryption key.
[in]init_vectoris the AES initialization vector for encryption.
Returns
if successful, returns HAL_AES_STATUS_OK
Example
Sample code, please refer to How to use this driver
hal_aes_status_t hal_aes_cbc_encrypt ( hal_aes_buffer_t encrypted_text,
hal_aes_buffer_t plain_text,
hal_aes_buffer_t key,
uint8_t  init_vector[HAL_AES_CBC_IV_LENGTH] 
)

This function provides an AES encryption in a CBC mode.

Parameters
[out]encrypted_textis the target encrypted text.
[in]plain_textis the source plain text.
[in]keyis the AES encryption key.
[in]init_vectoris the AES initialzation vector for encryption.
Returns
if successful, returns HAL_AES_STATUS_OK
Example
Sample code, please refer to How to use this driver
hal_aes_status_t hal_aes_ecb_decrypt ( hal_aes_buffer_t plain_text,
hal_aes_buffer_t encrypted_text,
hal_aes_buffer_t key 
)

This function provides an AES decryption in a EBC mode.

Parameters
[out]plain_textis the target plain text.
[in]encrypted_textis the source encrypted text.
[in]keyis the AES encryption key.
Returns
if successful, returns HAL_AES_STATUS_OK
Example
Sample code, please refer to How to use this driver
hal_aes_status_t hal_aes_ecb_encrypt ( hal_aes_buffer_t encrypted_text,
hal_aes_buffer_t plain_text,
hal_aes_buffer_t key 
)

This function provides an AES encryption in a EBC mode.

Parameters
[out]encrypted_textis the target encrypted text.
[in]plain_textis the source plain text.
[in]keyis the AES encryption key.
Returns
if successful, returns HAL_AES_STATUS_OK
Example
Sample code, please refer to How to use this driver