Files | |
file | crypto.h |
This file contains the prototype of crypto driver APIs. | |
Data Structures | |
struct | Crypto_Context |
CRYPTO driver context. More... | |
struct | Crypto_Params |
CRYPTO Parameters for various operations. More... | |
Functions | |
void | Crypto_init (void) |
This function initializes the Crypto module. More... | |
void | Crypto_deinit (void) |
This function de-initializes the Crypto module. More... | |
Crypto_Handle | Crypto_open (Crypto_Context *ctx) |
This function opens a Crypto module. More... | |
int32_t | Crypto_close (Crypto_Handle handle) |
Function to close a Crypto module. More... | |
int32_t | Crypto_hmacSha (Crypto_Params *params) |
This function calculates oPad & iPad for HMAC. More... | |
int32_t | Crypto_cmacGenSubKeys (Crypto_Params *params) |
This function Generate Sub keys for CMAC calculation. More... | |
Typedefs | |
typedef void * | Crypto_Handle |
Handle to the Crypto driver returned by Crypto_open() More... | |
Macros | |
#define | CRYPTO_HMAC_SHA_MAX_KEYLEN_BYTES (128U) |
Key length for HMAC-SHA Process. More... | |
#define | CRYPTO_HMAC_SHA512_KEYLEN_BYTES (128U) |
Key length for HMAC-SHA512 Process. More... | |
#define | CRYPTO_HMAC_SHA1_KEYLEN_BYTES (64U) |
Key length for HMAC-SHA1 Process. More... | |
#define | CRYPTO_HMAC_SHA256_KEYLEN_BYTES (64U) |
Key length for HMAC-SHA256 Process. More... | |
#define | CRYPTO_HMAC_SHA_IPAD (0x36U) |
Inner Padding value for HMAC. More... | |
#define | CRYPTO_HMAC_SHA_OPAD (0x5CU) |
Outer Padding value for HMAC. More... | |
#define | CRYPTO_AES_CMAC_KEY_LENGTH (16U) |
Aes Cmac key length. More... | |
#define | CRYPTO_AES_BLOCK_LENGTH (16U) |
Aes block length. More... | |
#define CRYPTO_HMAC_SHA_MAX_KEYLEN_BYTES (128U) |
Key length for HMAC-SHA Process.
#define CRYPTO_HMAC_SHA512_KEYLEN_BYTES (128U) |
Key length for HMAC-SHA512 Process.
#define CRYPTO_HMAC_SHA1_KEYLEN_BYTES (64U) |
Key length for HMAC-SHA1 Process.
#define CRYPTO_HMAC_SHA256_KEYLEN_BYTES (64U) |
Key length for HMAC-SHA256 Process.
#define CRYPTO_HMAC_SHA_IPAD (0x36U) |
Inner Padding value for HMAC.
#define CRYPTO_HMAC_SHA_OPAD (0x5CU) |
Outer Padding value for HMAC.
#define CRYPTO_AES_CMAC_KEY_LENGTH (16U) |
Aes Cmac key length.
#define CRYPTO_AES_BLOCK_LENGTH (16U) |
Aes block length.
typedef void* Crypto_Handle |
Handle to the Crypto driver returned by Crypto_open()
void Crypto_init | ( | void | ) |
This function initializes the Crypto module.
void Crypto_deinit | ( | void | ) |
This function de-initializes the Crypto module.
Crypto_Handle Crypto_open | ( | Crypto_Context * | ctx | ) |
This function opens a Crypto module.
ctx | The Crypto Context to initialize. This must not be NULL . |
int32_t Crypto_close | ( | Crypto_Handle | handle | ) |
Function to close a Crypto module.
handle | The Crypto 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 Crypto context. |
int32_t Crypto_hmacSha | ( | Crypto_Params * | params | ) |
This function calculates oPad & iPad for HMAC.
params | params for ipad and opad calculation |
0
on success. A negative error code on failure. int32_t Crypto_cmacGenSubKeys | ( | Crypto_Params * | params | ) |
This function Generate Sub keys for CMAC calculation.
params | params for key1 and key2 calculation |
0
on success. A negative error code on failure.