Data Structures | |
struct | Crypto_AesParams |
Parameters passed during Crypto_aesOpen() More... | |
struct | Crypto_AesCommonFxns |
Driver implementation callbacks. More... | |
struct | Crypto_AesCbcFxns |
Driver implementation callbacks. More... | |
struct | Crypto_AesCmacFxns |
Driver implementation callbacks. More... | |
struct | Crypto_AesFxns |
Driver implementation callbacks. More... | |
struct | Crypto_AesContext |
CRYPTO AES driver context. More... | |
struct | Crypto_AesConfig |
CRYPTO AES global configuration array. More... | |
Functions | |
void | Crypto_AesParams_init (Crypto_AesParams *params) |
Set default parameters in the Crypto_AesParams structure. More... | |
Crypto_AesHandle | Crypto_aesOpen (Crypto_AesContext *ctx, const Crypto_AesParams *params) |
This function gives the configuration based on type. More... | |
int32_t | Crypto_aesClose (Crypto_AesHandle handle) |
This function clears a Advance Encryption Standard (AES) context. More... | |
int32_t | Crypto_aesSetKeyEnc (Crypto_AesHandle handle) |
This function sets the Advance Encryption Standard (AES) encryption key. More... | |
int32_t | Crypto_aesSetKeyDec (Crypto_AesHandle handle) |
This function sets the Advance Encryption Standard (AES) decryption key. More... | |
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, and writes the result to the output buffer. More... | |
int32_t | Crypto_cmacSetup (Crypto_AesHandle handle) |
This function prepares a cipher context for use with the given cipher primitive. More... | |
int32_t | Crypto_cmacStarts (Crypto_AesHandle handle) |
This function sets the CMAC key, and prepares to authenticate the input data. More... | |
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. More... | |
int32_t | Crypto_cmacFinish (Crypto_AesHandle handle, uint8_t *output) |
This function finishes the CMAC operation, and writes the result to the output buffer. More... | |
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 (AES-CMAC) of a buffer. More... | |
Typedefs | |
typedef void * | Crypto_AesHandle |
Handle to the Crypto AES driver returned by Crypto_aesOpen() More... | |
typedef int32_t(* | Crypto_AesOpenFxn) (Crypto_AesContext *ctx, const Crypto_AesParams *params) |
common callback functions declarations More... | |
typedef int32_t(* | Crypto_AesCloseFxn) (Crypto_AesContext *ctx) |
typedef int32_t(* | Crypto_AesSetKeyEncFxn) (Crypto_AesContext *ctx) |
aes cbc callback functions declarations More... | |
typedef int32_t(* | Crypto_AesSetKeyDecFxn) (Crypto_AesContext *ctx) |
typedef int32_t(* | Crypto_AesCbcFxn) (Crypto_AesContext *ctx, const uint8_t *input, uint32_t inputLength, uint8_t *output) |
typedef int32_t(* | Crypto_CmacSetUpFxn) (Crypto_AesContext *ctx) |
aes cmac callback functions declarations More... | |
typedef int32_t(* | Crypto_CmacStartFxn) (Crypto_AesContext *ctx) |
typedef int32_t(* | Crypto_CmacUpdateFxn) (Crypto_AesContext *ctx, const uint8_t *input, uint32_t ilen) |
typedef int32_t(* | Crypto_CmacFinishFxn) (Crypto_AesContext *ctx, uint8_t *output) |
typedef int32_t(* | Crypto_CmacSingleShotFxn) (Crypto_AesContext *ctx, const uint8_t *input, uint32_t ilen, uint8_t *output) |
Macros | |
#define | CRYPTO_AES_IV_LENGTH (16U) |
IV buffer length should be 16 bytes. More... | |
#define | CRYPTO_AES_KEY_LENGTH (32U) |
key buffer length, min 16 bytes and max 32 bytes More... | |
AES algorithm type | |
#define | CRYPTO_AES_DECRYPT (0U) |
AES decryption algorithm. More... | |
#define | CRYPTO_AES_ENCRYPT (1U) |
AES encryption algorithm. More... | |
#define | CRYPTO_AES_CMAC (2U) |
AES CMAC algorithm. More... | |
AES modes | |
#define | CRYPTO_AES_CBC_128 (0U) |
AES CBC 128 bit MODE and Key size should be 128 bits. More... | |
#define | CRYPTO_AES_CBC_192 (1U) |
AES CBC 192 bit MODE and Key size should be 192 bits. More... | |
#define | CRYPTO_AES_CBC_256 (2U) |
AES CBC 256 bit MODE and Key size should be 256 bits. More... | |
#define | CRYPTO_AES_CMAC_128 (3U) |
AES CMAC with 128-bit ECB mode. More... | |
#define | CRYPTO_AES_CMAC_192 (4U) |
AES CMAC with 192-bit ECB mode. More... | |
#define | CRYPTO_AES_CMAC_256 (5U) |
AES CMAC with 256-bit ECB mode. More... | |
#define CRYPTO_AES_DECRYPT (0U) |
AES decryption algorithm.
#define CRYPTO_AES_ENCRYPT (1U) |
AES encryption algorithm.
#define CRYPTO_AES_CMAC (2U) |
AES CMAC algorithm.
#define CRYPTO_AES_CBC_128 (0U) |
AES CBC 128 bit MODE and Key size should be 128 bits.
#define CRYPTO_AES_CBC_192 (1U) |
AES CBC 192 bit MODE and Key size should be 192 bits.
#define CRYPTO_AES_CBC_256 (2U) |
AES CBC 256 bit MODE and Key size should be 256 bits.
#define CRYPTO_AES_CMAC_128 (3U) |
AES CMAC with 128-bit ECB mode.
#define CRYPTO_AES_CMAC_192 (4U) |
AES CMAC with 192-bit ECB mode.
#define CRYPTO_AES_CMAC_256 (5U) |
AES CMAC with 256-bit ECB mode.
#define CRYPTO_AES_IV_LENGTH (16U) |
IV buffer length should be 16 bytes.
#define CRYPTO_AES_KEY_LENGTH (32U) |
key buffer length, min 16 bytes and max 32 bytes
typedef void* Crypto_AesHandle |
Handle to the Crypto AES driver returned by Crypto_aesOpen()
typedef int32_t(* Crypto_AesOpenFxn) (Crypto_AesContext *ctx, const Crypto_AesParams *params) |
common callback functions declarations
typedef int32_t(* Crypto_AesCloseFxn) (Crypto_AesContext *ctx) |
typedef int32_t(* Crypto_AesSetKeyEncFxn) (Crypto_AesContext *ctx) |
aes cbc callback functions declarations
typedef int32_t(* Crypto_AesSetKeyDecFxn) (Crypto_AesContext *ctx) |
typedef int32_t(* Crypto_AesCbcFxn) (Crypto_AesContext *ctx, const uint8_t *input, uint32_t inputLength, uint8_t *output) |
typedef int32_t(* Crypto_CmacSetUpFxn) (Crypto_AesContext *ctx) |
aes cmac callback functions declarations
typedef int32_t(* Crypto_CmacStartFxn) (Crypto_AesContext *ctx) |
typedef int32_t(* Crypto_CmacUpdateFxn) (Crypto_AesContext *ctx, const uint8_t *input, uint32_t ilen) |
typedef int32_t(* Crypto_CmacFinishFxn) (Crypto_AesContext *ctx, uint8_t *output) |
typedef int32_t(* Crypto_CmacSingleShotFxn) (Crypto_AesContext *ctx, const uint8_t *input, uint32_t ilen, uint8_t *output) |
void Crypto_AesParams_init | ( | Crypto_AesParams * | params | ) |
Set default parameters in the Crypto_AesParams structure.
Call this API to set defaults and then override the fields as needed before calling Crypto_aesOpen.
params | [OUT] Initialized parameters |
Crypto_AesHandle Crypto_aesOpen | ( | Crypto_AesContext * | ctx, |
const Crypto_AesParams * | params | ||
) |
This function gives the configuration based on type.
ctx | The AES context to initialize. This must not be NULL . |
params | Type to which to assign the context |
int32_t Crypto_aesClose | ( | Crypto_AesHandle | handle | ) |
This function clears a Advance Encryption Standard (AES) context.
handle | The AES context to clear. This may be NULL , in which case this function does nothing. If it is not NULL , it must point to an initialized AES context. |
int32_t Crypto_aesSetKeyEnc | ( | Crypto_AesHandle | handle | ) |
This function sets the Advance Encryption Standard (AES) encryption key.
handle | AES driver handle from Crypto_aesOpen. |
0
on success. A negative error code on failure. int32_t Crypto_aesSetKeyDec | ( | Crypto_AesHandle | handle | ) |
This function sets the Advance Encryption Standard (AES) decryption key.
handle | AES driver handle from Crypto_aesOpen. |
0
on success. A negative error code on failure. 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, and writes the result to the output buffer.
handle | AES driver handle from Crypto_aesOpen |
input | The buffer holding the input data. This must be a readable buffer of length ilen Bytes. |
ilen | The length of the input data in Bytes. |
output | The AES algorithm result. |
0
on success. A negative error code on failure. int32_t Crypto_cmacSetup | ( | Crypto_AesHandle | handle | ) |
This function prepares a cipher context for use with the given cipher primitive.
handle | AES driver handle from Crypto_aesOpen. |
0
on success. A negative error code on failure. int32_t Crypto_cmacStarts | ( | Crypto_AesHandle | handle | ) |
This function sets the CMAC key, and prepares to authenticate the input data.
handle | AES driver handle from Crypto_aesOpen. |
0
on success. A negative error code on failure. 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.
handle | AES driver handle from Crypto_aesOpen. |
input | The buffer holding the input data. This must be a readable buffer of length ilen Bytes. |
ilen | The length of the input data in Bytes. |
0
on success. A negative error code on failure. int32_t Crypto_cmacFinish | ( | Crypto_AesHandle | handle, |
uint8_t * | output | ||
) |
This function finishes the CMAC operation, and writes the result to the output buffer.
handle | AES driver handle from Crypto_aesOpen. |
output | The AES cmac algorithm result. |
0
on success. A negative error code on failure. 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 (AES-CMAC) of a buffer.
handle | AES driver handle from Crypto_aesOpen. |
input | The buffer holding the input data. This must be a readable buffer of length ilen Bytes. |
ilen | The length of the input data in Bytes. |
output | The AES cmac algorithm result. |
0
on success. A negative error code on failure.
|
extern |
Externally defined AES driver configuration array.