AM64x MCU+ SDK  08.02.00

Introduction

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

Macro Definition Documentation

◆ CRYPTO_HMAC_SHA_MAX_KEYLEN_BYTES

#define CRYPTO_HMAC_SHA_MAX_KEYLEN_BYTES   (128U)

Key length for HMAC-SHA Process.

◆ CRYPTO_HMAC_SHA512_KEYLEN_BYTES

#define CRYPTO_HMAC_SHA512_KEYLEN_BYTES   (128U)

Key length for HMAC-SHA512 Process.

◆ CRYPTO_HMAC_SHA1_KEYLEN_BYTES

#define CRYPTO_HMAC_SHA1_KEYLEN_BYTES   (64U)

Key length for HMAC-SHA1 Process.

◆ CRYPTO_HMAC_SHA256_KEYLEN_BYTES

#define CRYPTO_HMAC_SHA256_KEYLEN_BYTES   (64U)

Key length for HMAC-SHA256 Process.

◆ CRYPTO_HMAC_SHA_IPAD

#define CRYPTO_HMAC_SHA_IPAD   (0x36U)

Inner Padding value for HMAC.

◆ CRYPTO_HMAC_SHA_OPAD

#define CRYPTO_HMAC_SHA_OPAD   (0x5CU)

Outer Padding value for HMAC.

◆ CRYPTO_AES_CMAC_KEY_LENGTH

#define CRYPTO_AES_CMAC_KEY_LENGTH   (16U)

Aes Cmac key length.

◆ CRYPTO_AES_BLOCK_LENGTH

#define CRYPTO_AES_BLOCK_LENGTH   (16U)

Aes block length.

Typedef Documentation

◆ Crypto_Handle

typedef void* Crypto_Handle

Handle to the Crypto driver returned by Crypto_open()

Function Documentation

◆ Crypto_init()

void Crypto_init ( void  )

This function initializes the Crypto module.

◆ Crypto_deinit()

void Crypto_deinit ( void  )

This function de-initializes the Crypto module.

◆ Crypto_open()

Crypto_Handle Crypto_open ( Crypto_Context ctx)

This function opens a Crypto module.

Parameters
ctxThe Crypto Context to initialize. This must not be NULL.

◆ Crypto_close()

int32_t Crypto_close ( Crypto_Handle  handle)

Function to close a Crypto module.

Parameters
handleThe 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.

◆ Crypto_hmacSha()

int32_t Crypto_hmacSha ( Crypto_Params params)

This function calculates oPad & iPad for HMAC.

Parameters
paramsparams for ipad and opad calculation
Returns
status 0 on success. A negative error code on failure.

◆ Crypto_cmacGenSubKeys()

int32_t Crypto_cmacGenSubKeys ( Crypto_Params params)

This function Generate Sub keys for CMAC calculation.

Parameters
paramsparams for key1 and key2 calculation
Returns
status 0 on success. A negative error code on failure.