ChibiOS/HAL
7.0.3
|
Generic Crypto Driver. More...
![]() |
Generic Crypto Driver.
This module implements a generic Cryptography driver.
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... | |
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... | |
#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.
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.
Definition at line 63 of file hal_crypto.h.
#define HAL_CRY_ENFORCE_FALLBACK FALSE |
Makes the driver forcibly use the fall-back implementations.
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.
FALSE
. Definition at line 68 of file hal_crypto_lld.h.
typedef size_t bitsize_t |
Size, in bits, of a crypto field or message.
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.
Type of a structure representing an CRY driver.
Definition at line 88 of file hal_crypto_lld.h.
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.
Definition at line 89 of file hal_crypto.h.
enum cryalgorithm_t |
Type of an algorithm identifier.
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.
void cryInit | ( | void | ) |
Cryptographic Driver initialization.
halInit()
, there is no need to explicitly initialize the driver.Definition at line 56 of file hal_crypto.c.
References cry_lld_init().
Referenced by halInit().
void cryObjectInit | ( | CRYDriver * | cryp | ) |
Initializes the standard part of a CRYDriver
structure.
[out] | cryp | pointer to the CRYDriver object |
Definition at line 70 of file hal_crypto.c.
References CRYDriver::config, CRY_STOP, and CRYDriver::state.
Configures and activates the cryptographic peripheral.
[in] | cryp | pointer to the CRYDriver object |
[in] | config | pointer to the CRYConfig object. Depending on the implementation the value can be NULL . |
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.
void cryStop | ( | CRYDriver * | cryp | ) |
Deactivates the cryptographic peripheral.
[in] | cryp | pointer to the CRYDriver object |
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.
cryerror_t cryLoadAESTransientKey | ( | CRYDriver * | cryp, |
size_t | size, | ||
const uint8_t * | keyp | ||
) |
Initializes the AES transient key.
[in] | cryp | pointer to the CRYDriver object |
[in] | size | key size in bytes |
[in] | keyp | pointer to the key data |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the algorithm is unsupported. |
CRY_ERR_INV_KEY_SIZE | if the specified key size is invalid for the specified algorithm. |
Definition at line 144 of file hal_crypto.c.
References CRY_ERR_INV_ALGO, cry_lld_aes_loadkey(), and osalDbgCheck.
cryerror_t cryEncryptAES | ( | CRYDriver * | cryp, |
crykey_t | key_id, | ||
const uint8_t * | in, | ||
uint8_t * | out | ||
) |
Encryption of a single block using AES.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryDecryptAES | ( | CRYDriver * | cryp, |
crykey_t | key_id, | ||
const uint8_t * | in, | ||
uint8_t * | out | ||
) |
Decryption of a single block using AES.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
[in] | iv | 128 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
[in] | iv | 128 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits input vector + counter, it contains a 96 bits IV and a 32 bits counter |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 16 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
[in] | iv | 128 bits input vector + counter, it contains a 96 bits IV and a 32 bits counter |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | auth_size | size of the data buffer to be authenticated |
[in] | auth_in | buffer containing the data to be authenticated |
[in] | text_size | size of the text buffer, this number must be a multiple of 16 |
[in] | text_in | buffer containing the input plaintext |
[out] | text_out | buffer for the output cyphertext |
[in] | iv | 128 bits input vector |
[in] | tag_size | size of the authentication tag, this number must be between 1 and 16 |
[out] | tag_out | buffer for the generated authentication tag |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | auth_size | size of the data buffer to be authenticated |
[in] | auth_in | buffer containing the data to be authenticated |
[in] | text_size | size of the text buffer, this number must be a multiple of 16 |
[in] | text_in | buffer containing the input plaintext |
[out] | text_out | buffer for the output cyphertext |
[in] | iv | 128 bits input vector |
[in] | tag_size | size of the authentication tag, this number must be between 1 and 16 |
[in] | tag_in | buffer for the generated authentication tag |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_AUTH_FAILED | authentication failed |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryLoadDESTransientKey | ( | CRYDriver * | cryp, |
size_t | size, | ||
const uint8_t * | keyp | ||
) |
Initializes the DES transient key.
[in] | cryp | pointer to the CRYDriver object |
[in] | size | key size in bytes |
[in] | keyp | pointer to the key data |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the algorithm is unsupported. |
CRY_ERR_INV_KEY_SIZE | if the specified key size is invalid for the specified algorithm. |
Definition at line 861 of file hal_crypto.c.
References CRY_ERR_INV_ALGO, cry_lld_des_loadkey(), and osalDbgCheck.
cryerror_t cryEncryptDES | ( | CRYDriver * | cryp, |
crykey_t | key_id, | ||
const uint8_t * | in, | ||
uint8_t * | out | ||
) |
Encryption of a single block using (T)DES.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryDecryptDES | ( | CRYDriver * | cryp, |
crykey_t | key_id, | ||
const uint8_t * | in, | ||
uint8_t * | out | ||
) |
Decryption of a single block using (T)DES.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 8 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 8 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 8 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 64 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of both buffers, this number must be a multiple of 8 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
[in] | iv | 64 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA1Init | ( | CRYDriver * | cryp, |
SHA1Context * | sha1ctxp | ||
) |
Hash initialization using SHA1.
[in] | cryp | pointer to the CRYDriver object |
[out] | sha1ctxp | pointer to a SHA1 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA1Update | ( | CRYDriver * | cryp, |
SHA1Context * | sha1ctxp, | ||
size_t | size, | ||
const uint8_t * | in | ||
) |
Hash update using SHA1.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha1ctxp | pointer to a SHA1 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA1Final | ( | CRYDriver * | cryp, |
SHA1Context * | sha1ctxp, | ||
uint8_t * | out | ||
) |
Hash finalization using SHA1.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha1ctxp | pointer to a SHA1 context |
[out] | out | 160 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA256Init | ( | CRYDriver * | cryp, |
SHA256Context * | sha256ctxp | ||
) |
Hash initialization using SHA256.
[in] | cryp | pointer to the CRYDriver object |
[out] | sha256ctxp | pointer to a SHA256 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA256Update | ( | CRYDriver * | cryp, |
SHA256Context * | sha256ctxp, | ||
size_t | size, | ||
const uint8_t * | in | ||
) |
Hash update using SHA256.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha256ctxp | pointer to a SHA256 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA256Final | ( | CRYDriver * | cryp, |
SHA256Context * | sha256ctxp, | ||
uint8_t * | out | ||
) |
Hash finalization using SHA256.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha256ctxp | pointer to a SHA256 context |
[out] | out | 256 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA512Init | ( | CRYDriver * | cryp, |
SHA512Context * | sha512ctxp | ||
) |
Hash initialization using SHA512.
[in] | cryp | pointer to the CRYDriver object |
[out] | sha512ctxp | pointer to a SHA512 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA512Update | ( | CRYDriver * | cryp, |
SHA512Context * | sha512ctxp, | ||
size_t | size, | ||
const uint8_t * | in | ||
) |
Hash update using SHA512.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha512ctxp | pointer to a SHA512 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t crySHA512Final | ( | CRYDriver * | cryp, |
SHA512Context * | sha512ctxp, | ||
uint8_t * | out | ||
) |
Hash finalization using SHA512.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha512ctxp | pointer to a SHA512 context |
[out] | out | 512 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryLoadHMACTransientKey | ( | CRYDriver * | cryp, |
size_t | size, | ||
const uint8_t * | keyp | ||
) |
Initializes the HMAC transient key.
[in] | cryp | pointer to the CRYDriver object |
[in] | size | key size in bytes |
[in] | keyp | pointer to the key data |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the algorithm is unsupported. |
CRY_ERR_INV_KEY_SIZE | if the specified key size is invalid for the specified algorithm. |
Definition at line 1518 of file hal_crypto.c.
References CRY_ERR_INV_ALGO, cry_lld_hmac_loadkey(), and osalDbgCheck.
cryerror_t cryHMACSHA256Init | ( | CRYDriver * | cryp, |
HMACSHA256Context * | hmacsha256ctxp | ||
) |
Hash initialization using HMAC_SHA256.
[in] | cryp | pointer to the CRYDriver object |
[out] | hmacsha256ctxp | pointer to a HMAC_SHA256 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryHMACSHA256Update | ( | CRYDriver * | cryp, |
HMACSHA256Context * | hmacsha256ctxp, | ||
size_t | size, | ||
const uint8_t * | in | ||
) |
Hash update using HMAC.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha256ctxp | pointer to a HMAC_SHA256 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryHMACSHA256Final | ( | CRYDriver * | cryp, |
HMACSHA256Context * | hmacsha256ctxp, | ||
uint8_t * | out | ||
) |
Hash finalization using HMAC.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha256ctxp | pointer to a HMAC_SHA256 context |
[out] | out | 256 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryHMACSHA512Init | ( | CRYDriver * | cryp, |
HMACSHA512Context * | hmacsha512ctxp | ||
) |
Hash initialization using HMAC_SHA512.
[in] | cryp | pointer to the CRYDriver object |
[out] | hmacsha512ctxp | pointer to a HMAC_SHA512 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryHMACSHA512Update | ( | CRYDriver * | cryp, |
HMACSHA512Context * | hmacsha512ctxp, | ||
size_t | size, | ||
const uint8_t * | in | ||
) |
Hash update using HMAC.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha512ctxp | pointer to a HMAC_SHA512 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
cryerror_t cryHMACSHA512Final | ( | CRYDriver * | cryp, |
HMACSHA512Context * | hmacsha512ctxp, | ||
uint8_t * | out | ||
) |
Hash finalization using HMAC.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha512ctxp | pointer to a HMAC_SHA512 context |
[out] | out | 512 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
void cry_lld_init | ( | void | ) |
Low level crypto driver initialization.
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.
[in] | cryp | pointer to the CRYDriver object |
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.
[in] | cryp | pointer to the CRYDriver object |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | size | key size in bytes |
[in] | keyp | pointer to the key data |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the algorithm is unsupported. |
CRY_ERR_INV_KEY_SIZE | if the specified key size is invalid for the specified algorithm. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of the selected key size |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of the selected key size |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of the selected key size |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits initial vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of the selected key size |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits initial vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of the selected key size |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits initial vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of the selected key size |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits initial vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of 16 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 128 bits initial vector + counter, it contains a 96 bits IV and a 32 bits counter |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of 16 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
[in] | iv | 128 bits initial vector + counter, it contains a 96 bits IV and a 32 bits counter |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | auth_size | size of the data buffer to be authenticated |
[in] | auth_in | buffer containing the data to be authenticated |
[in] | text_size | size of the text buffer, this number must be a multiple of 16 |
[in] | text_in | buffer containing the input plaintext |
[out] | text_out | buffer for the output cyphertext |
[in] | iv | 128 bits input vector |
[in] | tag_size | size of the authentication tag, this number must be between 1 and 16 |
[out] | tag_out | buffer for the generated authentication tag |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | auth_size | size of the data buffer to be authenticated |
[in] | auth_in | buffer containing the data to be authenticated |
[in] | text_size | size of the text buffer, this number must be a multiple of 16 |
[in] | text_in | buffer containing the input plaintext |
[out] | text_out | buffer for the output cyphertext |
[in] | iv | 128 bits input vector |
[in] | tag_size | size of the authentication tag, this number must be between 1 and 16 |
[in] | tag_in | buffer for the generated authentication tag |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_AUTH_FAILED | authentication failed |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | size | key size in bytes |
[in] | keyp | pointer to the key data |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the algorithm is unsupported. |
CRY_ERR_INV_KEY_SIZE | if the specified key size is invalid for the specified algorithm. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of 8 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of 8 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of 8 |
[in] | in | buffer containing the input plaintext |
[out] | out | buffer for the output cyphertext |
[in] | iv | 64 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | key_id | the key to be used for the operation, zero is the transient key, other values are keys stored in an unspecified way |
[in] | size | size of the plaintext buffer, this number must be a multiple of 8 |
[in] | in | buffer containing the input cyphertext |
[out] | out | buffer for the output plaintext |
[in] | iv | 64 bits input vector |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_INV_KEY_TYPE | the selected key is invalid for this operation. |
CRY_ERR_INV_KEY_ID | if the specified key identifier is invalid or refers to an empty key slot. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[out] | sha1ctxp | pointer to a SHA1 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha1ctxp | pointer to a SHA1 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha1ctxp | pointer to a SHA1 context |
[out] | out | 160 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[out] | sha256ctxp | pointer to a SHA256 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha256ctxp | pointer to a SHA256 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha256ctxp | pointer to a SHA256 context |
[out] | out | 256 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[out] | sha512ctxp | pointer to a SHA512 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha512ctxp | pointer to a SHA512 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | sha512ctxp | pointer to a SHA512 context |
[out] | out | 512 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | size | key size in bytes |
[in] | keyp | pointer to the key data |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the algorithm is unsupported. |
CRY_ERR_INV_KEY_SIZE | if the specified key size is invalid for the specified algorithm. |
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.
[in] | cryp | pointer to the CRYDriver object |
[out] | hmacsha256ctxp | pointer to a HMAC_SHA256 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha256ctxp | pointer to a HMAC_SHA256 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha256ctxp | pointer to a HMAC_SHA256 context |
[out] | out | 256 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[out] | hmacsha512ctxp | pointer to a HMAC_SHA512 context to be initialized |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha512ctxp | pointer to a HMAC_SHA512 context |
[in] | size | size of input buffer |
[in] | in | buffer containing the input text |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
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.
[in] | cryp | pointer to the CRYDriver object |
[in] | hmacsha512ctxp | pointer to a HMAC_SHA512 context |
[out] | out | 512 bits output buffer |
CRY_NOERROR | if the operation succeeded. |
CRY_ERR_INV_ALGO | if the operation is unsupported on this device instance. |
CRY_ERR_OP_FAILURE | if the operation failed, implementation dependent. |
Definition at line 1350 of file hal_crypto_lld.c.
References CRY_ERR_INV_ALGO.
Referenced by cryHMACSHA512Final().
CRYDriver CRYD1 |
CRY1 driver identifier.
Definition at line 39 of file hal_crypto_lld.c.