ChibiOS/HAL  7.0.3
Crypto Driver

Generic Crypto Driver. More...

Collaboration diagram for Crypto Driver:

Detailed Description

Generic Crypto Driver.

This module implements a generic Cryptography driver.

Precondition
In order to use the crypto driver the HAL_USE_CRY option must be enabled in halconf.h.

Macros

#define HAL_CRY_USE_FALLBACK   FALSE
 Enables the SW fall-back of the cryptographic driver. More...
 
#define HAL_CRY_USE_FALLBACK   TRUE
 Enables the SW fall-back of the cryptographic driver. More...
 
#define HAL_CRY_ENFORCE_FALLBACK   FALSE
 Makes the driver forcibly use the fall-back implementations. More...
 

Driver capability switches

#define CRY_LLD_SUPPORTS_AES   TRUE
 
#define CRY_LLD_SUPPORTS_AES_ECB   TRUE
 
#define CRY_LLD_SUPPORTS_AES_CBC   TRUE
 
#define CRY_LLD_SUPPORTS_AES_CFB   TRUE
 
#define CRY_LLD_SUPPORTS_AES_CTR   TRUE
 
#define CRY_LLD_SUPPORTS_AES_GCM   TRUE
 
#define CRY_LLD_SUPPORTS_DES   TRUE
 
#define CRY_LLD_SUPPORTS_DES_ECB   TRUE
 
#define CRY_LLD_SUPPORTS_DES_CBC   TRUE
 
#define CRY_LLD_SUPPORTS_SHA1   TRUE
 
#define CRY_LLD_SUPPORTS_SHA256   TRUE
 
#define CRY_LLD_SUPPORTS_SHA512   TRUE
 
#define CRY_LLD_SUPPORTS_HMAC_SHA256   TRUE
 
#define CRY_LLD_SUPPORTS_HMAC_SHA512   TRUE
 

PLATFORM configuration options

#define PLATFORM_CRY_USE_CRY1   FALSE
 CRY1 driver enable switch. More...
 

Typedefs

typedef size_t bitsize_t
 Size, in bits, of a crypto field or message. More...
 
typedef uint32_t crykey_t
 CRY key identifier type. More...
 
typedef struct CRYDriver CRYDriver
 Type of a structure representing an CRY driver. More...
 

Data Structures

struct  SHA1Context
 Type of a SHA1 context. More...
 
struct  SHA256Context
 Type of a SHA256 context. More...
 
struct  SHA512Context
 Type of a SHA512 context. More...
 
struct  HMACSHA256Context
 Type of a HMAC_SHA256 context. More...
 
struct  HMACSHA512Context
 Type of a HMAC_SHA512 context. More...
 
struct  CRYConfig
 Driver configuration structure. More...
 
struct  CRYDriver
 Structure representing an CRY driver. More...
 

Functions

void cryInit (void)
 Cryptographic Driver initialization. More...
 
void cryObjectInit (CRYDriver *cryp)
 Initializes the standard part of a CRYDriver structure. More...
 
void cryStart (CRYDriver *cryp, const CRYConfig *config)
 Configures and activates the cryptographic peripheral. More...
 
void cryStop (CRYDriver *cryp)
 Deactivates the cryptographic peripheral. More...
 
cryerror_t cryLoadAESTransientKey (CRYDriver *cryp, size_t size, const uint8_t *keyp)
 Initializes the AES transient key. More...
 
cryerror_t cryEncryptAES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Encryption of a single block using AES. More...
 
cryerror_t cryDecryptAES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Decryption of a single block using AES. More...
 
cryerror_t cryEncryptAES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Encryption operation using AES-ECB. More...
 
cryerror_t cryDecryptAES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Decryption operation using AES-ECB. More...
 
cryerror_t cryEncryptAES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using AES-CBC. More...
 
cryerror_t cryDecryptAES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using AES-CBC. More...
 
cryerror_t cryEncryptAES_CFB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using AES-CFB. More...
 
cryerror_t cryDecryptAES_CFB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using AES-CFB. More...
 
cryerror_t cryEncryptAES_CTR (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using AES-CTR. More...
 
cryerror_t cryDecryptAES_CTR (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using AES-CTR. More...
 
cryerror_t cryEncryptAES_GCM (CRYDriver *cryp, crykey_t key_id, size_t auth_size, const uint8_t *auth_in, size_t text_size, const uint8_t *text_in, uint8_t *text_out, const uint8_t *iv, size_t tag_size, uint8_t *tag_out)
 Encryption operation using AES-GCM. More...
 
cryerror_t cryDecryptAES_GCM (CRYDriver *cryp, crykey_t key_id, size_t auth_size, const uint8_t *auth_in, size_t text_size, const uint8_t *text_in, uint8_t *text_out, const uint8_t *iv, size_t tag_size, const uint8_t *tag_in)
 Decryption operation using AES-GCM. More...
 
cryerror_t cryLoadDESTransientKey (CRYDriver *cryp, size_t size, const uint8_t *keyp)
 Initializes the DES transient key. More...
 
cryerror_t cryEncryptDES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Encryption of a single block using (T)DES. More...
 
cryerror_t cryDecryptDES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Decryption of a single block using (T)DES. More...
 
cryerror_t cryEncryptDES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Encryption operation using (T)DES-ECB. More...
 
cryerror_t cryDecryptDES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Decryption operation using (T)DES-ECB. More...
 
cryerror_t cryEncryptDES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using (T)DES-CBC. More...
 
cryerror_t cryDecryptDES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using (T)DES-CBC. More...
 
cryerror_t crySHA1Init (CRYDriver *cryp, SHA1Context *sha1ctxp)
 Hash initialization using SHA1. More...
 
cryerror_t crySHA1Update (CRYDriver *cryp, SHA1Context *sha1ctxp, size_t size, const uint8_t *in)
 Hash update using SHA1. More...
 
cryerror_t crySHA1Final (CRYDriver *cryp, SHA1Context *sha1ctxp, uint8_t *out)
 Hash finalization using SHA1. More...
 
cryerror_t crySHA256Init (CRYDriver *cryp, SHA256Context *sha256ctxp)
 Hash initialization using SHA256. More...
 
cryerror_t crySHA256Update (CRYDriver *cryp, SHA256Context *sha256ctxp, size_t size, const uint8_t *in)
 Hash update using SHA256. More...
 
cryerror_t crySHA256Final (CRYDriver *cryp, SHA256Context *sha256ctxp, uint8_t *out)
 Hash finalization using SHA256. More...
 
cryerror_t crySHA512Init (CRYDriver *cryp, SHA512Context *sha512ctxp)
 Hash initialization using SHA512. More...
 
cryerror_t crySHA512Update (CRYDriver *cryp, SHA512Context *sha512ctxp, size_t size, const uint8_t *in)
 Hash update using SHA512. More...
 
cryerror_t crySHA512Final (CRYDriver *cryp, SHA512Context *sha512ctxp, uint8_t *out)
 Hash finalization using SHA512. More...
 
cryerror_t cryLoadHMACTransientKey (CRYDriver *cryp, size_t size, const uint8_t *keyp)
 Initializes the HMAC transient key. More...
 
cryerror_t cryHMACSHA256Init (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp)
 Hash initialization using HMAC_SHA256. More...
 
cryerror_t cryHMACSHA256Update (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp, size_t size, const uint8_t *in)
 Hash update using HMAC. More...
 
cryerror_t cryHMACSHA256Final (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp, uint8_t *out)
 Hash finalization using HMAC. More...
 
cryerror_t cryHMACSHA512Init (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp)
 Hash initialization using HMAC_SHA512. More...
 
cryerror_t cryHMACSHA512Update (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp, size_t size, const uint8_t *in)
 Hash update using HMAC. More...
 
cryerror_t cryHMACSHA512Final (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp, uint8_t *out)
 Hash finalization using HMAC. More...
 
void cry_lld_init (void)
 Low level crypto driver initialization. More...
 
void cry_lld_start (CRYDriver *cryp)
 Configures and activates the crypto peripheral. More...
 
void cry_lld_stop (CRYDriver *cryp)
 Deactivates the crypto peripheral. More...
 
cryerror_t cry_lld_aes_loadkey (CRYDriver *cryp, size_t size, const uint8_t *keyp)
 Initializes the AES transient key. More...
 
cryerror_t cry_lld_encrypt_AES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Encryption of a single block using AES. More...
 
cryerror_t cry_lld_decrypt_AES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Decryption of a single block using AES. More...
 
cryerror_t cry_lld_encrypt_AES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Encryption operation using AES-ECB. More...
 
cryerror_t cry_lld_decrypt_AES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Decryption operation using AES-ECB. More...
 
cryerror_t cry_lld_encrypt_AES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using AES-CBC. More...
 
cryerror_t cry_lld_decrypt_AES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using AES-CBC. More...
 
cryerror_t cry_lld_encrypt_AES_CFB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using AES-CFB. More...
 
cryerror_t cry_lld_decrypt_AES_CFB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using AES-CFB. More...
 
cryerror_t cry_lld_encrypt_AES_CTR (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using AES-CTR. More...
 
cryerror_t cry_lld_decrypt_AES_CTR (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using AES-CTR. More...
 
cryerror_t cry_lld_encrypt_AES_GCM (CRYDriver *cryp, crykey_t key_id, size_t auth_size, const uint8_t *auth_in, size_t text_size, const uint8_t *text_in, uint8_t *text_out, const uint8_t *iv, size_t tag_size, uint8_t *tag_out)
 Encryption operation using AES-GCM. More...
 
cryerror_t cry_lld_decrypt_AES_GCM (CRYDriver *cryp, crykey_t key_id, size_t auth_size, const uint8_t *auth_in, size_t text_size, const uint8_t *text_in, uint8_t *text_out, const uint8_t *iv, size_t tag_size, const uint8_t *tag_in)
 Decryption operation using AES-GCM. More...
 
cryerror_t cry_lld_des_loadkey (CRYDriver *cryp, size_t size, const uint8_t *keyp)
 Initializes the DES transient key. More...
 
cryerror_t cry_lld_encrypt_DES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Encryption of a single block using (T)DES. More...
 
cryerror_t cry_lld_decrypt_DES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out)
 Decryption of a single block using (T)DES. More...
 
cryerror_t cry_lld_encrypt_DES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Encryption operation using (T)DES-ECB. More...
 
cryerror_t cry_lld_decrypt_DES_ECB (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out)
 Decryption operation using (T)DES-ECB. More...
 
cryerror_t cry_lld_encrypt_DES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Encryption operation using (T)DES-CBC. More...
 
cryerror_t cry_lld_decrypt_DES_CBC (CRYDriver *cryp, crykey_t key_id, size_t size, const uint8_t *in, uint8_t *out, const uint8_t *iv)
 Decryption operation using (T)DES-CBC. More...
 
cryerror_t cry_lld_SHA1_init (CRYDriver *cryp, SHA1Context *sha1ctxp)
 Hash initialization using SHA1. More...
 
cryerror_t cry_lld_SHA1_update (CRYDriver *cryp, SHA1Context *sha1ctxp, size_t size, const uint8_t *in)
 Hash update using SHA1. More...
 
cryerror_t cry_lld_SHA1_final (CRYDriver *cryp, SHA1Context *sha1ctxp, uint8_t *out)
 Hash finalization using SHA1. More...
 
cryerror_t cry_lld_SHA256_init (CRYDriver *cryp, SHA256Context *sha256ctxp)
 Hash initialization using SHA256. More...
 
cryerror_t cry_lld_SHA256_update (CRYDriver *cryp, SHA256Context *sha256ctxp, size_t size, const uint8_t *in)
 Hash update using SHA256. More...
 
cryerror_t cry_lld_SHA256_final (CRYDriver *cryp, SHA256Context *sha256ctxp, uint8_t *out)
 Hash finalization using SHA256. More...
 
cryerror_t cry_lld_SHA512_init (CRYDriver *cryp, SHA512Context *sha512ctxp)
 Hash initialization using SHA512. More...
 
cryerror_t cry_lld_SHA512_update (CRYDriver *cryp, SHA512Context *sha512ctxp, size_t size, const uint8_t *in)
 Hash update using SHA512. More...
 
cryerror_t cry_lld_SHA512_final (CRYDriver *cryp, SHA512Context *sha512ctxp, uint8_t *out)
 Hash finalization using SHA512. More...
 
cryerror_t cry_lld_hmac_loadkey (CRYDriver *cryp, size_t size, const uint8_t *keyp)
 Initializes the HMAC transient key. More...
 
cryerror_t cry_lld_HMACSHA256_init (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp)
 Hash initialization using HMAC_SHA256. More...
 
cryerror_t cry_lld_HMACSHA256_update (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp, size_t size, const uint8_t *in)
 Hash update using HMAC. More...
 
cryerror_t cry_lld_HMACSHA256_final (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp, uint8_t *out)
 Hash finalization using HMAC. More...
 
cryerror_t cry_lld_HMACSHA512_init (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp)
 Hash initialization using HMAC_SHA512. More...
 
cryerror_t cry_lld_HMACSHA512_update (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp, size_t size, const uint8_t *in)
 Hash update using HMAC. More...
 
cryerror_t cry_lld_HMACSHA512_final (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp, uint8_t *out)
 Hash finalization using HMAC. More...
 

Enumerations

Variables

CRYDriver CRYD1
 CRY1 driver identifier. More...
 

Macro Definition Documentation

#define HAL_CRY_USE_FALLBACK   FALSE

Enables the SW fall-back of the cryptographic driver.

When enabled, this option, activates a fall-back software implementation for algorithms not supported by the underlying hardware.

Note
Fall-back implementations may not be present for all algorithms.

Definition at line 63 of file hal_crypto.h.

#define HAL_CRY_USE_FALLBACK   TRUE

Enables the SW fall-back of the cryptographic driver.

When enabled, this option, activates a fall-back software implementation for algorithms not supported by the underlying hardware.

Note
Fall-back implementations may not be present for all algorithms.

Definition at line 63 of file hal_crypto.h.

#define HAL_CRY_ENFORCE_FALLBACK   FALSE

Makes the driver forcibly use the fall-back implementations.

Note
If enabled then the LLD driver is not included at all.

Definition at line 54 of file hal_crypto.h.

#define PLATFORM_CRY_USE_CRY1   FALSE

CRY1 driver enable switch.

If set to TRUE the support for CRY1 is included.

Note
The default is FALSE.

Definition at line 68 of file hal_crypto_lld.h.

Typedef Documentation

typedef size_t bitsize_t

Size, in bits, of a crypto field or message.

Note
It is assumed, for simplicity, that this type is equivalent to a size_t.

Definition at line 75 of file hal_crypto.h.

typedef uint32_t crykey_t

CRY key identifier type.

Definition at line 83 of file hal_crypto_lld.h.

typedef struct CRYDriver CRYDriver

Type of a structure representing an CRY driver.

Definition at line 88 of file hal_crypto_lld.h.

Enumeration Type Documentation

enum crystate_t

Driver state machine possible states.

Enumerator
CRY_UNINIT 

Not initialized.

CRY_STOP 

Stopped.

CRY_READY 

Ready.

Definition at line 80 of file hal_crypto.h.

enum cryerror_t

Driver error codes.

Enumerator
CRY_NOERROR 

No error.

CRY_ERR_INV_ALGO 

Invalid cypher/mode.

CRY_ERR_INV_KEY_SIZE 

Invalid key size.

CRY_ERR_INV_KEY_TYPE 

Invalid key type.

CRY_ERR_INV_KEY_ID 

Invalid key identifier.

CRY_ERR_AUTH_FAILED 

Failed authentication.

CRY_ERR_OP_FAILURE 

Failed operation.

Definition at line 89 of file hal_crypto.h.

Type of an algorithm identifier.

Note
It is only used to determine the key required for operations.
Enumerator
cry_algo_aes 

AES 128, 192, 256 bits.

cry_algo_des 

DES 56, TDES 112, 168 bits.

cry_algo_hmac 

HMAC variable size.

Definition at line 103 of file hal_crypto.h.

Function Documentation

void cryInit ( void  )

Cryptographic Driver initialization.

Note
This function is implicitly invoked by halInit(), there is no need to explicitly initialize the driver.
Function Class:Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 56 of file hal_crypto.c.

References cry_lld_init().

Referenced by halInit().

Here is the call graph for this function:

void cryObjectInit ( CRYDriver cryp)

Initializes the standard part of a CRYDriver structure.

Parameters
[out]cryppointer to the CRYDriver object
Function Class:Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 70 of file hal_crypto.c.

References CRYDriver::config, CRY_STOP, and CRYDriver::state.

void cryStart ( CRYDriver cryp,
const CRYConfig config 
)

Configures and activates the cryptographic peripheral.

Parameters
[in]cryppointer to the CRYDriver object
[in]configpointer to the CRYConfig object. Depending on the implementation the value can be NULL.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 88 of file hal_crypto.c.

References CRYDriver::config, cry_lld_start(), CRY_READY, CRY_STOP, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), and CRYDriver::state.

Here is the call graph for this function:

void cryStop ( CRYDriver cryp)

Deactivates the cryptographic peripheral.

Parameters
[in]cryppointer to the CRYDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 110 of file hal_crypto.c.

References CRYDriver::config, cry_lld_stop(), CRY_READY, CRY_STOP, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryLoadAESTransientKey ( CRYDriver cryp,
size_t  size,
const uint8_t *  keyp 
)

Initializes the AES transient key.

Note
It is the underlying implementation to decide which key sizes are allowable.
Parameters
[in]cryppointer to the CRYDriver object
[in]sizekey size in bytes
[in]keyppointer to the key data
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the algorithm is unsupported.
CRY_ERR_INV_KEY_SIZEif the specified key size is invalid for the specified algorithm.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 144 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_aes_loadkey(), and osalDbgCheck.

Here is the call graph for this function:

cryerror_t cryEncryptAES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Encryption of a single block using AES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Special function, this function has special requirements see the notes.

Definition at line 187 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_AES(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptAES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Decryption of a single block using AES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Special function, this function has special requirements see the notes.

Definition at line 233 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_AES(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryEncryptAES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Encryption operation using AES-ECB.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 282 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_AES_ECB(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptAES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Decryption operation using AES-ECB.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 334 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_AES_ECB(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryEncryptAES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using AES-CBC.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 387 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_AES_CBC(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptAES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using AES-CBC.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
[in]iv128 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 442 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_AES_CBC(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryEncryptAES_CFB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using AES-CFB.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 497 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_AES_CFB(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptAES_CFB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using AES-CFB.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
[in]iv128 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 552 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_AES_CFB(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryEncryptAES_CTR ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using AES-CTR.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits input vector + counter, it contains a 96 bits IV and a 32 bits counter
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 608 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_AES_CTR(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptAES_CTR ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using AES-CTR.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 16
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
[in]iv128 bits input vector + counter, it contains a 96 bits IV and a 32 bits counter
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 664 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_AES_CTR(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryEncryptAES_GCM ( CRYDriver cryp,
crykey_t  key_id,
size_t  auth_size,
const uint8_t *  auth_in,
size_t  text_size,
const uint8_t *  text_in,
uint8_t *  text_out,
const uint8_t *  iv,
size_t  tag_size,
uint8_t *  tag_out 
)

Encryption operation using AES-GCM.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]auth_sizesize of the data buffer to be authenticated
[in]auth_inbuffer containing the data to be authenticated
[in]text_sizesize of the text buffer, this number must be a multiple of 16
[in]text_inbuffer containing the input plaintext
[out]text_outbuffer for the output cyphertext
[in]iv128 bits input vector
[in]tag_sizesize of the authentication tag, this number must be between 1 and 16
[out]tag_outbuffer for the generated authentication tag
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 724 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_AES_GCM(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptAES_GCM ( CRYDriver cryp,
crykey_t  key_id,
size_t  auth_size,
const uint8_t *  auth_in,
size_t  text_size,
const uint8_t *  text_in,
uint8_t *  text_out,
const uint8_t *  iv,
size_t  tag_size,
const uint8_t *  tag_in 
)

Decryption operation using AES-GCM.

Note
The function operates on data buffers whose length is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]auth_sizesize of the data buffer to be authenticated
[in]auth_inbuffer containing the data to be authenticated
[in]text_sizesize of the text buffer, this number must be a multiple of 16
[in]text_inbuffer containing the input plaintext
[out]text_outbuffer for the output cyphertext
[in]iv128 bits input vector
[in]tag_sizesize of the authentication tag, this number must be between 1 and 16
[in]tag_inbuffer for the generated authentication tag
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_AUTH_FAILEDauthentication failed
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 801 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_AES_GCM(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryLoadDESTransientKey ( CRYDriver cryp,
size_t  size,
const uint8_t *  keyp 
)

Initializes the DES transient key.

Note
It is the underlying implementation to decide which key sizes are allowable.
Parameters
[in]cryppointer to the CRYDriver object
[in]sizekey size in bytes
[in]keyppointer to the key data
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the algorithm is unsupported.
CRY_ERR_INV_KEY_SIZEif the specified key size is invalid for the specified algorithm.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 861 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_des_loadkey(), and osalDbgCheck.

Here is the call graph for this function:

cryerror_t cryEncryptDES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Encryption of a single block using (T)DES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Special function, this function has special requirements see the notes.

Definition at line 904 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_DES(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptDES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Decryption of a single block using (T)DES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Special function, this function has special requirements see the notes.

Definition at line 951 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_DES(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryEncryptDES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Encryption operation using (T)DES-ECB.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 8
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1000 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_DES_ECB(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptDES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Decryption operation using (T)DES-ECB.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 8
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1052 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_DES_ECB(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryEncryptDES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using (T)DES-CBC.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 8
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv64 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1105 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_encrypt_DES_CBC(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryDecryptDES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using (T)DES-CBC.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of both buffers, this number must be a multiple of 8
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
[in]iv64 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1160 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_decrypt_DES_CBC(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA1Init ( CRYDriver cryp,
SHA1Context sha1ctxp 
)

Hash initialization using SHA1.

Note
Use of this algorithm is not recommended because proven weak.
Parameters
[in]cryppointer to the CRYDriver object
[out]sha1ctxppointer to a SHA1 context to be initialized
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1203 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA1_init(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA1Update ( CRYDriver cryp,
SHA1Context sha1ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using SHA1.

Note
Use of this algorithm is not recommended because proven weak.
Parameters
[in]cryppointer to the CRYDriver object
[in]sha1ctxppointer to a SHA1 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1238 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA1_update(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA1Final ( CRYDriver cryp,
SHA1Context sha1ctxp,
uint8_t *  out 
)

Hash finalization using SHA1.

Note
Use of this algorithm is not recommended because proven weak.
Parameters
[in]cryppointer to the CRYDriver object
[in]sha1ctxppointer to a SHA1 context
[out]out160 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1275 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA1_final(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA256Init ( CRYDriver cryp,
SHA256Context sha256ctxp 
)

Hash initialization using SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[out]sha256ctxppointer to a SHA256 context to be initialized
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1308 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA256_init(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA256Update ( CRYDriver cryp,
SHA256Context sha256ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha256ctxppointer to a SHA256 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1342 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA256_update(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA256Final ( CRYDriver cryp,
SHA256Context sha256ctxp,
uint8_t *  out 
)

Hash finalization using SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha256ctxppointer to a SHA256 context
[out]out256 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1378 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA256_final(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA512Init ( CRYDriver cryp,
SHA512Context sha512ctxp 
)

Hash initialization using SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[out]sha512ctxppointer to a SHA512 context to be initialized
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1412 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA512_init(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA512Update ( CRYDriver cryp,
SHA512Context sha512ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha512ctxppointer to a SHA512 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1446 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA512_update(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t crySHA512Final ( CRYDriver cryp,
SHA512Context sha512ctxp,
uint8_t *  out 
)

Hash finalization using SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha512ctxppointer to a SHA512 context
[out]out512 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1482 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_SHA512_final(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryLoadHMACTransientKey ( CRYDriver cryp,
size_t  size,
const uint8_t *  keyp 
)

Initializes the HMAC transient key.

Note
It is the underlying implementation to decide which key sizes are allowable.
Parameters
[in]cryppointer to the CRYDriver object
[in]sizekey size in bytes
[in]keyppointer to the key data
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the algorithm is unsupported.
CRY_ERR_INV_KEY_SIZEif the specified key size is invalid for the specified algorithm.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1518 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_hmac_loadkey(), and osalDbgCheck.

Here is the call graph for this function:

cryerror_t cryHMACSHA256Init ( CRYDriver cryp,
HMACSHA256Context hmacsha256ctxp 
)

Hash initialization using HMAC_SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[out]hmacsha256ctxppointer to a HMAC_SHA256 context to be initialized
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1553 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_HMACSHA256_init(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryHMACSHA256Update ( CRYDriver cryp,
HMACSHA256Context hmacsha256ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha256ctxppointer to a HMAC_SHA256 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1588 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_HMACSHA256_update(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryHMACSHA256Final ( CRYDriver cryp,
HMACSHA256Context hmacsha256ctxp,
uint8_t *  out 
)

Hash finalization using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha256ctxppointer to a HMAC_SHA256 context
[out]out256 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1626 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_HMACSHA256_final(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryHMACSHA512Init ( CRYDriver cryp,
HMACSHA512Context hmacsha512ctxp 
)

Hash initialization using HMAC_SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[out]hmacsha512ctxppointer to a HMAC_SHA512 context to be initialized
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1662 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_HMACSHA512_init(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryHMACSHA512Update ( CRYDriver cryp,
HMACSHA512Context hmacsha512ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha512ctxppointer to a HMAC_SHA512 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1697 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_HMACSHA512_update(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

cryerror_t cryHMACSHA512Final ( CRYDriver cryp,
HMACSHA512Context hmacsha512ctxp,
uint8_t *  out 
)

Hash finalization using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha512ctxppointer to a HMAC_SHA512 context
[out]out512 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1735 of file hal_crypto.c.

References CRY_ERR_INV_ALGO, cry_lld_HMACSHA512_final(), CRY_READY, osalDbgAssert, osalDbgCheck, and CRYDriver::state.

Here is the call graph for this function:

void cry_lld_init ( void  )

Low level crypto driver initialization.

Function Class:Not an API, this function is for internal use only.

Definition at line 63 of file hal_crypto_lld.c.

Referenced by cryInit().

void cry_lld_start ( CRYDriver cryp)

Configures and activates the crypto peripheral.

Parameters
[in]cryppointer to the CRYDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 74 of file hal_crypto_lld.c.

References CRY_STOP, and CRYDriver::state.

Referenced by cryStart().

void cry_lld_stop ( CRYDriver cryp)

Deactivates the crypto peripheral.

Parameters
[in]cryppointer to the CRYDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 88 of file hal_crypto_lld.c.

References CRY_READY, and CRYDriver::state.

Referenced by cryStop().

cryerror_t cry_lld_aes_loadkey ( CRYDriver cryp,
size_t  size,
const uint8_t *  keyp 
)

Initializes the AES transient key.

Note
It is the underlying implementation to decide which key sizes are allowable.
Parameters
[in]cryppointer to the CRYDriver object
[in]sizekey size in bytes
[in]keyppointer to the key data
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the algorithm is unsupported.
CRY_ERR_INV_KEY_SIZEif the specified key size is invalid for the specified algorithm.
Function Class:Not an API, this function is for internal use only.

Definition at line 112 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryLoadAESTransientKey().

cryerror_t cry_lld_encrypt_AES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Encryption of a single block using AES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 146 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptAES().

cryerror_t cry_lld_decrypt_AES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Decryption of a single block using AES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 182 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptAES().

cryerror_t cry_lld_encrypt_AES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Encryption operation using AES-ECB.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of the selected key size
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 223 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptAES_ECB().

cryerror_t cry_lld_decrypt_AES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Decryption operation using AES-ECB.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of the selected key size
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 264 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptAES_ECB().

cryerror_t cry_lld_encrypt_AES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using AES-CBC.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of the selected key size
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits initial vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 308 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptAES_CBC().

cryerror_t cry_lld_decrypt_AES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using AES-CBC.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of the selected key size
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits initial vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 352 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptAES_CBC().

cryerror_t cry_lld_encrypt_AES_CFB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using AES-CFB.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of the selected key size
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits initial vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 398 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptAES_CFB().

cryerror_t cry_lld_decrypt_AES_CFB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using AES-CFB.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of the selected key size
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits initial vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 442 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptAES_CFB().

cryerror_t cry_lld_encrypt_AES_CTR ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using AES-CTR.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of 16
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv128 bits initial vector + counter, it contains a 96 bits IV and a 32 bits counter
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 489 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptAES_CTR().

cryerror_t cry_lld_decrypt_AES_CTR ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using AES-CTR.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of 16
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
[in]iv128 bits initial vector + counter, it contains a 96 bits IV and a 32 bits counter
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 534 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptAES_CTR().

cryerror_t cry_lld_encrypt_AES_GCM ( CRYDriver cryp,
crykey_t  key_id,
size_t  auth_size,
const uint8_t *  auth_in,
size_t  text_size,
const uint8_t *  text_in,
uint8_t *  text_out,
const uint8_t *  iv,
size_t  tag_size,
uint8_t *  tag_out 
)

Encryption operation using AES-GCM.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]auth_sizesize of the data buffer to be authenticated
[in]auth_inbuffer containing the data to be authenticated
[in]text_sizesize of the text buffer, this number must be a multiple of 16
[in]text_inbuffer containing the input plaintext
[out]text_outbuffer for the output cyphertext
[in]iv128 bits input vector
[in]tag_sizesize of the authentication tag, this number must be between 1 and 16
[out]tag_outbuffer for the generated authentication tag
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 585 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptAES_GCM().

cryerror_t cry_lld_decrypt_AES_GCM ( CRYDriver cryp,
crykey_t  key_id,
size_t  auth_size,
const uint8_t *  auth_in,
size_t  text_size,
const uint8_t *  text_in,
uint8_t *  text_out,
const uint8_t *  iv,
size_t  tag_size,
const uint8_t *  tag_in 
)

Decryption operation using AES-GCM.

Note
The function operates on data buffers whose lenght is a multiple of an AES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]auth_sizesize of the data buffer to be authenticated
[in]auth_inbuffer containing the data to be authenticated
[in]text_sizesize of the text buffer, this number must be a multiple of 16
[in]text_inbuffer containing the input plaintext
[out]text_outbuffer for the output cyphertext
[in]iv128 bits input vector
[in]tag_sizesize of the authentication tag, this number must be between 1 and 16
[in]tag_inbuffer for the generated authentication tag
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_AUTH_FAILEDauthentication failed
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 643 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptAES_GCM().

cryerror_t cry_lld_des_loadkey ( CRYDriver cryp,
size_t  size,
const uint8_t *  keyp 
)

Initializes the DES transient key.

Note
It is the underlying implementation to decide which key sizes are allowable.
Parameters
[in]cryppointer to the CRYDriver object
[in]sizekey size in bytes
[in]keyppointer to the key data
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the algorithm is unsupported.
CRY_ERR_INV_KEY_SIZEif the specified key size is invalid for the specified algorithm.
Function Class:Not an API, this function is for internal use only.

Definition at line 686 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryLoadDESTransientKey().

cryerror_t cry_lld_encrypt_DES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Encryption of a single block using (T)DES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 720 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptDES().

cryerror_t cry_lld_decrypt_DES ( CRYDriver cryp,
crykey_t  key_id,
const uint8_t *  in,
uint8_t *  out 
)

Decryption of a single block using (T)DES.

Note
The implementation of this function must guarantee that it can be called from any context.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 757 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptDES().

cryerror_t cry_lld_encrypt_DES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Encryption operation using (T)DES-ECB.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of 8
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 798 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptDES_ECB().

cryerror_t cry_lld_decrypt_DES_ECB ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out 
)

Decryption operation using (T)DES-ECB.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of 8
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
Returns
T he operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 839 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptDES_ECB().

cryerror_t cry_lld_encrypt_DES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Encryption operation using (T)DES-CBC.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of 8
[in]inbuffer containing the input plaintext
[out]outbuffer for the output cyphertext
[in]iv64 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 883 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryEncryptDES_CBC().

cryerror_t cry_lld_decrypt_DES_CBC ( CRYDriver cryp,
crykey_t  key_id,
size_t  size,
const uint8_t *  in,
uint8_t *  out,
const uint8_t *  iv 
)

Decryption operation using (T)DES-CBC.

Note
The function operates on data buffers whose length is a multiple of an DES block, this means that padding must be done by the caller.
Parameters
[in]cryppointer to the CRYDriver object
[in]key_idthe key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way
[in]sizesize of the plaintext buffer, this number must be a multiple of 8
[in]inbuffer containing the input cyphertext
[out]outbuffer for the output plaintext
[in]iv64 bits input vector
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_INV_KEY_TYPEthe selected key is invalid for this operation.
CRY_ERR_INV_KEY_IDif the specified key identifier is invalid or refers to an empty key slot.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 927 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryDecryptDES_CBC().

cryerror_t cry_lld_SHA1_init ( CRYDriver cryp,
SHA1Context sha1ctxp 
)

Hash initialization using SHA1.

Note
Use of this algorithm is not recommended because proven weak.
Parameters
[in]cryppointer to the CRYDriver object
[out]sha1ctxppointer to a SHA1 context to be initialized
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 960 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA1Init().

cryerror_t cry_lld_SHA1_update ( CRYDriver cryp,
SHA1Context sha1ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using SHA1.

Note
Use of this algorithm is not recommended because proven weak.
Parameters
[in]cryppointer to the CRYDriver object
[in]sha1ctxppointer to a SHA1 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 985 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA1Update().

cryerror_t cry_lld_SHA1_final ( CRYDriver cryp,
SHA1Context sha1ctxp,
uint8_t *  out 
)

Hash finalization using SHA1.

Note
Use of this algorithm is not recommended because proven weak.
Parameters
[in]cryppointer to the CRYDriver object
[in]sha1ctxppointer to a SHA1 context
[out]out160 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1012 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA1Final().

cryerror_t cry_lld_SHA256_init ( CRYDriver cryp,
SHA256Context sha256ctxp 
)

Hash initialization using SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[out]sha256ctxppointer to a SHA256 context to be initialized
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1037 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA256Init().

cryerror_t cry_lld_SHA256_update ( CRYDriver cryp,
SHA256Context sha256ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha256ctxppointer to a SHA256 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1061 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA256Update().

cryerror_t cry_lld_SHA256_final ( CRYDriver cryp,
SHA256Context sha256ctxp,
uint8_t *  out 
)

Hash finalization using SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha256ctxppointer to a SHA256 context
[out]out256 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1087 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA256Final().

cryerror_t cry_lld_SHA512_init ( CRYDriver cryp,
SHA512Context sha512ctxp 
)

Hash initialization using SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[out]sha512ctxppointer to a SHA512 context to be initialized
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1112 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA512Init().

cryerror_t cry_lld_SHA512_update ( CRYDriver cryp,
SHA512Context sha512ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha512ctxppointer to a SHA512 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1136 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA512Update().

cryerror_t cry_lld_SHA512_final ( CRYDriver cryp,
SHA512Context sha512ctxp,
uint8_t *  out 
)

Hash finalization using SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[in]sha512ctxppointer to a SHA512 context
[out]out512 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1162 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by crySHA512Final().

cryerror_t cry_lld_hmac_loadkey ( CRYDriver cryp,
size_t  size,
const uint8_t *  keyp 
)

Initializes the HMAC transient key.

Note
It is the underlying implementation to decide which key sizes are allowable.
Parameters
[in]cryppointer to the CRYDriver object
[in]sizekey size in bytes
[in]keyppointer to the key data
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the algorithm is unsupported.
CRY_ERR_INV_KEY_SIZEif the specified key size is invalid for the specified algorithm.
Function Class:Not an API, this function is for internal use only.

Definition at line 1190 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryLoadHMACTransientKey().

cryerror_t cry_lld_HMACSHA256_init ( CRYDriver cryp,
HMACSHA256Context hmacsha256ctxp 
)

Hash initialization using HMAC_SHA256.

Parameters
[in]cryppointer to the CRYDriver object
[out]hmacsha256ctxppointer to a HMAC_SHA256 context to be initialized
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1216 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryHMACSHA256Init().

cryerror_t cry_lld_HMACSHA256_update ( CRYDriver cryp,
HMACSHA256Context hmacsha256ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha256ctxppointer to a HMAC_SHA256 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1241 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryHMACSHA256Update().

cryerror_t cry_lld_HMACSHA256_final ( CRYDriver cryp,
HMACSHA256Context hmacsha256ctxp,
uint8_t *  out 
)

Hash finalization using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha256ctxppointer to a HMAC_SHA256 context
[out]out256 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1269 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryHMACSHA256Final().

cryerror_t cry_lld_HMACSHA512_init ( CRYDriver cryp,
HMACSHA512Context hmacsha512ctxp 
)

Hash initialization using HMAC_SHA512.

Parameters
[in]cryppointer to the CRYDriver object
[out]hmacsha512ctxppointer to a HMAC_SHA512 context to be initialized
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1297 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryHMACSHA512Init().

cryerror_t cry_lld_HMACSHA512_update ( CRYDriver cryp,
HMACSHA512Context hmacsha512ctxp,
size_t  size,
const uint8_t *  in 
)

Hash update using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha512ctxppointer to a HMAC_SHA512 context
[in]sizesize of input buffer
[in]inbuffer containing the input text
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1322 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryHMACSHA512Update().

cryerror_t cry_lld_HMACSHA512_final ( CRYDriver cryp,
HMACSHA512Context hmacsha512ctxp,
uint8_t *  out 
)

Hash finalization using HMAC.

Parameters
[in]cryppointer to the CRYDriver object
[in]hmacsha512ctxppointer to a HMAC_SHA512 context
[out]out512 bits output buffer
Returns
The operation status.
Return values
CRY_NOERRORif the operation succeeded.
CRY_ERR_INV_ALGOif the operation is unsupported on this device instance.
CRY_ERR_OP_FAILUREif the operation failed, implementation dependent.
Function Class:Not an API, this function is for internal use only.

Definition at line 1350 of file hal_crypto_lld.c.

References CRY_ERR_INV_ALGO.

Referenced by cryHMACSHA512Final().

Variable Documentation

CRYDriver CRYD1

CRY1 driver identifier.

Definition at line 39 of file hal_crypto_lld.c.