This section describes the programming interface of the DCP AES blocking driver.
|
status_t | DCP_AES_SetKey (DCP_Type *base, dcp_handle_t *handle, const uint8_t *key, size_t keySize) |
| Set AES key to dcp_handle_t struct and optionally to DCP. More...
|
|
status_t | DCP_AES_EncryptEcb (DCP_Type *base, dcp_handle_t *handle, const uint8_t *plaintext, uint8_t *ciphertext, size_t size) |
| Encrypts AES on one or multiple 128-bit block(s). More...
|
|
status_t | DCP_AES_DecryptEcb (DCP_Type *base, dcp_handle_t *handle, const uint8_t *ciphertext, uint8_t *plaintext, size_t size) |
| Decrypts AES on one or multiple 128-bit block(s). More...
|
|
status_t | DCP_AES_EncryptCbc (DCP_Type *base, dcp_handle_t *handle, const uint8_t *plaintext, uint8_t *ciphertext, size_t size, const uint8_t iv[16]) |
| Encrypts AES using CBC block mode. More...
|
|
status_t | DCP_AES_DecryptCbc (DCP_Type *base, dcp_handle_t *handle, const uint8_t *ciphertext, uint8_t *plaintext, size_t size, const uint8_t iv[16]) |
| Decrypts AES using CBC block mode. More...
|
|
status_t DCP_AES_SetKey |
( |
DCP_Type * |
base, |
|
|
dcp_handle_t * |
handle, |
|
|
const uint8_t * |
key, |
|
|
size_t |
keySize |
|
) |
| |
Sets the AES key for encryption/decryption with the dcp_handle_t structure. The dcp_handle_t input argument specifies keySlot. If the keySlot is kDCP_OtpKey, the function will check the OTP_KEY_READY bit and will return it's ready to use status. For other keySlot selections, the function will copy and hold the key in dcp_handle_t struct. If the keySlot is one of the four DCP SRAM-based keys (one of kDCP_KeySlot0, kDCP_KeySlot1, kDCP_KeySlot2, kDCP_KeySlot3), this function will also load the supplied key to the specified keySlot in DCP.
- Parameters
-
base | DCP peripheral base address. |
handle | Handle used for the request. |
key | 0-mod-4 aligned pointer to AES key. |
keySize | AES key size in bytes. Shall equal 16. |
- Returns
- status from set key operation
status_t DCP_AES_EncryptEcb |
( |
DCP_Type * |
base, |
|
|
dcp_handle_t * |
handle, |
|
|
const uint8_t * |
plaintext, |
|
|
uint8_t * |
ciphertext, |
|
|
size_t |
size |
|
) |
| |
Encrypts AES. The source plaintext and destination ciphertext can overlap in system memory.
- Parameters
-
| base | DCP peripheral base address |
| handle | Handle used for this request. |
| plaintext | Input plain text to encrypt |
[out] | ciphertext | Output cipher text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
- Returns
- Status from encrypt operation
status_t DCP_AES_DecryptEcb |
( |
DCP_Type * |
base, |
|
|
dcp_handle_t * |
handle, |
|
|
const uint8_t * |
ciphertext, |
|
|
uint8_t * |
plaintext, |
|
|
size_t |
size |
|
) |
| |
Decrypts AES. The source ciphertext and destination plaintext can overlap in system memory.
- Parameters
-
| base | DCP peripheral base address |
| handle | Handle used for this request. |
| ciphertext | Input plain text to encrypt |
[out] | plaintext | Output cipher text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
- Returns
- Status from decrypt operation
status_t DCP_AES_EncryptCbc |
( |
DCP_Type * |
base, |
|
|
dcp_handle_t * |
handle, |
|
|
const uint8_t * |
plaintext, |
|
|
uint8_t * |
ciphertext, |
|
|
size_t |
size, |
|
|
const uint8_t |
iv[16] |
|
) |
| |
Encrypts AES using CBC block mode. The source plaintext and destination ciphertext can overlap in system memory.
- Parameters
-
| base | DCP peripheral base address |
| handle | Handle used for this request. |
| plaintext | Input plain text to encrypt |
[out] | ciphertext | Output cipher text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
| iv | Input initial vector to combine with the first input block. |
- Returns
- Status from encrypt operation
status_t DCP_AES_DecryptCbc |
( |
DCP_Type * |
base, |
|
|
dcp_handle_t * |
handle, |
|
|
const uint8_t * |
ciphertext, |
|
|
uint8_t * |
plaintext, |
|
|
size_t |
size, |
|
|
const uint8_t |
iv[16] |
|
) |
| |
Decrypts AES using CBC block mode. The source ciphertext and destination plaintext can overlap in system memory.
- Parameters
-
| base | DCP peripheral base address |
| handle | Handle used for this request. |
| ciphertext | Input cipher text to decrypt |
[out] | plaintext | Output plain text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
| iv | Input initial vector to combine with the first input block. |
- Returns
- Status from decrypt operation