RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Macros | Functions
Dcp_driver_aes

Macros

#define DCP_AES_BLOCK_SIZE   16
 

Functions

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.
 
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).
 
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).
 
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.
 
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.
 

Detailed Description

Macro Definition Documentation

◆ DCP_AES_BLOCK_SIZE

#define DCP_AES_BLOCK_SIZE   16

AES block size in bytes

Function Documentation

◆ DCP_AES_DecryptCbc()

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.

Decrypts AES using CBC block mode. The source ciphertext and destination plaintext can overlap in system memory.

Parameters
baseDCP peripheral base address
handleHandle used for this request.
ciphertextInput cipher text to decrypt
[out]plaintextOutput plain text
sizeSize of input and output data in bytes. Must be multiple of 16 bytes.
ivInput initial vector to combine with the first input block.
Returns
Status from decrypt operation

brief Decrypts AES using CBC block mode.

Decrypts AES using CBC block mode. The source ciphertext and destination plaintext can overlap in system memory.

param base DCP peripheral base address param handle Handle used for this request. param ciphertext Input cipher text to decrypt param[out] plaintext Output plain text param size Size of input and output data in bytes. Must be multiple of 16 bytes. param iv Input initial vector to combine with the first input block. return Status from decrypt operation

◆ DCP_AES_DecryptEcb()

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).

Decrypts AES. The source ciphertext and destination plaintext can overlap in system memory.

Parameters
baseDCP peripheral base address
handleHandle used for this request.
ciphertextInput plain text to encrypt
[out]plaintextOutput cipher text
sizeSize of input and output data in bytes. Must be multiple of 16 bytes.
Returns
Status from decrypt operation

brief Decrypts AES on one or multiple 128-bit block(s).

Decrypts AES. The source ciphertext and destination plaintext can overlap in system memory.

param base DCP peripheral base address param handle Handle used for this request. param ciphertext Input plain text to encrypt param[out] plaintext Output cipher text param size Size of input and output data in bytes. Must be multiple of 16 bytes. return Status from decrypt operation

◆ DCP_AES_EncryptCbc()

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.

Encrypts AES using CBC block mode. The source plaintext and destination ciphertext can overlap in system memory.

Parameters
baseDCP peripheral base address
handleHandle used for this request.
plaintextInput plain text to encrypt
[out]ciphertextOutput cipher text
sizeSize of input and output data in bytes. Must be multiple of 16 bytes.
ivInput initial vector to combine with the first input block.
Returns
Status from encrypt operation

brief Encrypts AES using CBC block mode.

Encrypts AES using CBC block mode. The source plaintext and destination ciphertext can overlap in system memory.

param base DCP peripheral base address param handle Handle used for this request. param plaintext Input plain text to encrypt param[out] ciphertext Output cipher text param size Size of input and output data in bytes. Must be multiple of 16 bytes. param iv Input initial vector to combine with the first input block. return Status from encrypt operation

◆ DCP_AES_EncryptEcb()

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).

Encrypts AES. The source plaintext and destination ciphertext can overlap in system memory.

Parameters
baseDCP peripheral base address
handleHandle used for this request.
plaintextInput plain text to encrypt
[out]ciphertextOutput cipher text
sizeSize of input and output data in bytes. Must be multiple of 16 bytes.
Returns
Status from encrypt operation

brief Encrypts AES on one or multiple 128-bit block(s).

Encrypts AES. The source plaintext and destination ciphertext can overlap in system memory.

param base DCP peripheral base address param handle Handle used for this request. param plaintext Input plain text to encrypt param[out] ciphertext Output cipher text param size Size of input and output data in bytes. Must be multiple of 16 bytes. return Status from encrypt operation

◆ DCP_AES_SetKey()

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.

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
baseDCP peripheral base address.
handleHandle used for the request.
key0-mod-4 aligned pointer to AES key.
keySizeAES key size in bytes. Shall equal 16.
Returns
status from set key operation

brief Set AES key to dcp_handle_t struct and optionally to DCP.

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.

param base DCP peripheral base address. param handle Handle used for the request. param key 0-mod-4 aligned pointer to AES key. param keySize AES key size in bytes. Shall equal 16. return status from set key operation