|
AM64x MCU+ SDK
08.01.00
|
|
Go to the documentation of this file.
49 #include <security/crypto.h>
65 #define CRYPTO_AES_DECRYPT (0U)
67 #define CRYPTO_AES_ENCRYPT (1U)
69 #define CRYPTO_AES_CMAC (2U)
78 #define CRYPTO_AES_CBC_128 (0U)
80 #define CRYPTO_AES_CBC_192 (1U)
82 #define CRYPTO_AES_CBC_256 (2U)
84 #define CRYPTO_AES_CMAC_128 (3U)
86 #define CRYPTO_AES_CMAC_192 (4U)
88 #define CRYPTO_AES_CMAC_256 (5U)
92 #define CRYPTO_AES_IV_LENGTH (16U)
95 #define CRYPTO_AES_KEY_LENGTH (32U)
110 typedef struct Crypto_AesParams_s
133 typedef int32_t (*
Crypto_AesCbcFxn)(Crypto_AesContext *ctx,
const uint8_t *input, uint32_t inputLength, uint8_t *output );
143 typedef struct Crypto_AesCommonFxns_s
152 typedef struct Crypto_AesCbcFxns_s
163 typedef struct Crypto_AesCmacFxns_s
178 typedef struct Crypto_AesFxns_s
#define CRYPTO_AES_IV_LENGTH
IV buffer length should be 16 bytes.
Definition: crypto_aes.h:92
int32_t(* Crypto_AesSetKeyEncFxn)(Crypto_AesContext *ctx)
aes cbc callback functions declarations
Definition: crypto_aes.h:131
int32_t Crypto_aesSetKeyEnc(Crypto_AesHandle handle)
This function sets the Advance Encryption Standard (AES) encryption key.
int32_t(* Crypto_AesCloseFxn)(Crypto_AesContext *ctx)
Definition: crypto_aes.h:128
int32_t(* Crypto_CmacFinishFxn)(Crypto_AesContext *ctx, uint8_t *output)
Definition: crypto_aes.h:139
Crypto_AesOpenFxn openFxn
Definition: crypto_aes.h:145
uint32_t algoType
Definition: crypto_aes.h:114
int32_t(* Crypto_AesOpenFxn)(Crypto_AesContext *ctx, const Crypto_AesParams *params)
common callback functions declarations
Definition: crypto_aes.h:127
int32_t(* Crypto_CmacSingleShotFxn)(Crypto_AesContext *ctx, const uint8_t *input, uint32_t ilen, uint8_t *output)
Definition: crypto_aes.h:140
Crypto_AesFxns * fxns
Definition: crypto_aes.h:207
uint32_t type
Definition: crypto_aes.h:122
int32_t(* Crypto_CmacUpdateFxn)(Crypto_AesContext *ctx, const uint8_t *input, uint32_t ilen)
Definition: crypto_aes.h:138
CRYPTO AES driver context.
Definition: crypto_aes.h:190
Crypto_AesSetKeyDecFxn setKeyDecFxn
Definition: crypto_aes.h:156
int32_t Crypto_aesCbc(Crypto_AesHandle handle, const uint8_t *input, uint32_t ilen, uint8_t *output)
This function finishes the Advance Encryption Standard Cipher Block Chaining (AES-CBC) operation,...
Driver implementation callbacks.
Definition: crypto_aes.h:179
Crypto_AesHandle Crypto_aesOpen(Crypto_AesContext *ctx, const Crypto_AesParams *params)
This function gives the configuration based on type.
Driver implementation callbacks.
Definition: crypto_aes.h:144
int32_t(* Crypto_AesSetKeyDecFxn)(Crypto_AesContext *ctx)
Definition: crypto_aes.h:132
uintptr_t rsv[70U]
Definition: crypto_aes.h:195
int32_t(* Crypto_CmacStartFxn)(Crypto_AesContext *ctx)
Definition: crypto_aes.h:137
Crypto_AesCommonFxns * commonFxns
Definition: crypto_aes.h:180
Crypto_AesConfig gCryptoAesConfig[CRYPTO_NUM_TYPE]
Externally defined AES driver configuration array.
Crypto_AesCbcFxn cbcFxn
Definition: crypto_aes.h:158
Crypto_AesCbcFxns * cbcFxns
Definition: crypto_aes.h:182
int32_t(* Crypto_AesCbcFxn)(Crypto_AesContext *ctx, const uint8_t *input, uint32_t inputLength, uint8_t *output)
Definition: crypto_aes.h:133
void * Crypto_AesHandle
Handle to the Crypto AES driver returned by Crypto_aesOpen()
Definition: crypto_aes.h:98
Driver implementation callbacks.
Definition: crypto_aes.h:153
Crypto_AesSetKeyEncFxn setKeyEncFxn
Definition: crypto_aes.h:154
void Crypto_AesParams_init(Crypto_AesParams *params)
Set default parameters in the Crypto_AesParams structure.
int32_t Crypto_cmacSetup(Crypto_AesHandle handle)
This function prepares a cipher context for use with the given cipher primitive.
Crypto_CmacFinishFxn finishFxn
Definition: crypto_aes.h:171
Parameters passed during Crypto_aesOpen()
Definition: crypto_aes.h:111
Crypto_CmacUpdateFxn updateFxn
Definition: crypto_aes.h:169
int32_t Crypto_aesClose(Crypto_AesHandle handle)
This function clears a Advance Encryption Standard (AES) context.
Crypto_AesFxns * fxns
Definition: crypto_aes.h:193
Crypto_CmacSingleShotFxn singleShotFxn
Definition: crypto_aes.h:173
int32_t(* Crypto_CmacSetUpFxn)(Crypto_AesContext *ctx)
aes cmac callback functions declarations
Definition: crypto_aes.h:136
int32_t Crypto_cmacUpdate(Crypto_AesHandle handle, const uint8_t *input, uint32_t ilen)
This function feeds an input buffer into an ongoing CMAC computation.
Crypto_AesParams params
Definition: crypto_aes.h:191
int32_t Crypto_cmacSingleShot(Crypto_AesHandle handle, const uint8_t *input, uint32_t ilen, uint8_t *output)
This function calculates the Advance Encryption Standard Cipher-based Message Authentication Code (AE...
uint32_t aesMode
Definition: crypto_aes.h:112
Crypto_CmacStartFxn startFxn
Definition: crypto_aes.h:167
int32_t Crypto_cmacStarts(Crypto_AesHandle handle)
This function sets the CMAC key, and prepares to authenticate the input data.
CRYPTO AES global configuration array.
Definition: crypto_aes.h:206
Driver implementation callbacks.
Definition: crypto_aes.h:164
Crypto_AesCloseFxn closeFxn
Definition: crypto_aes.h:147
int32_t Crypto_aesSetKeyDec(Crypto_AesHandle handle)
This function sets the Advance Encryption Standard (AES) decryption key.
Crypto_AesCmacFxns * cmacFxns
Definition: crypto_aes.h:184
int32_t Crypto_cmacFinish(Crypto_AesHandle handle, uint8_t *output)
This function finishes the CMAC operation, and writes the result to the output buffer.
uint32_t keySizeInBits
Definition: crypto_aes.h:120
Crypto_CmacSetUpFxn setUpFxn
Definition: crypto_aes.h:165
#define CRYPTO_AES_KEY_LENGTH
key buffer length, min 16 bytes and max 32 bytes
Definition: crypto_aes.h:95