ChibiOS/HAL 9.0.0
|
Cryptographic Driver macros and structures. More...
Go to the source code of this file.
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... |
Macros | |
#define | HAL_CRY_USE_FALLBACK FALSE |
Enables the SW fall-back of the cryptographic driver. | |
#define | HAL_CRY_ENFORCE_FALLBACK FALSE |
Makes the driver forcibly use the fall-back implementations. | |
#define | HAL_CRY_USE_FALLBACK TRUE |
Enables the SW fall-back of the cryptographic driver. |
Typedefs | |
typedef size_t | bitsize_t |
Size, in bits, of a crypto field or message. |
Enumerations | |
enum | crystate_t { CRY_UNINIT = 0 , CRY_STOP = 1 , CRY_READY = 2 } |
Driver state machine possible states. More... | |
enum | cryerror_t { CRY_NOERROR = 0 , CRY_ERR_INV_ALGO = 1 , CRY_ERR_INV_KEY_SIZE = 2 , CRY_ERR_INV_KEY_TYPE = 3 , CRY_ERR_INV_KEY_ID = 4 , CRY_ERR_AUTH_FAILED = 5 , CRY_ERR_OP_FAILURE = 6 } |
Driver error codes. More... | |
enum | cryalgorithm_t { cry_algo_none = 0 , cry_algo_aes , cry_algo_des , cry_algo_hmac } |
Type of an algorithm identifier. More... |
Functions | |
void | cryInit (void) |
Cryptographic Driver initialization. | |
void | cryObjectInit (CRYDriver *cryp) |
Initializes the standard part of a CRYDriver structure. | |
msg_t | cryStart (CRYDriver *cryp, const CRYConfig *config) |
Configures and activates the cryptographic peripheral. | |
void | cryStop (CRYDriver *cryp) |
Deactivates the cryptographic peripheral. | |
cryerror_t | cryLoadAESTransientKey (CRYDriver *cryp, size_t size, const uint8_t *keyp) |
Initializes the AES transient key. | |
cryerror_t | cryEncryptAES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out) |
Encryption of a single block using AES. | |
cryerror_t | cryDecryptAES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out) |
Decryption of a single block using AES. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
cryerror_t | cryLoadDESTransientKey (CRYDriver *cryp, size_t size, const uint8_t *keyp) |
Initializes the DES transient key. | |
cryerror_t | cryEncryptDES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out) |
Encryption of a single block using (T)DES. | |
cryerror_t | cryDecryptDES (CRYDriver *cryp, crykey_t key_id, const uint8_t *in, uint8_t *out) |
Decryption of a single block using (T)DES. | |
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. | |
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. | |
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. | |
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. | |
cryerror_t | crySHA1Init (CRYDriver *cryp, SHA1Context *sha1ctxp) |
Hash initialization using SHA1. | |
cryerror_t | crySHA1Update (CRYDriver *cryp, SHA1Context *sha1ctxp, size_t size, const uint8_t *in) |
Hash update using SHA1. | |
cryerror_t | crySHA1Final (CRYDriver *cryp, SHA1Context *sha1ctxp, uint8_t *out) |
Hash finalization using SHA1. | |
cryerror_t | crySHA256Init (CRYDriver *cryp, SHA256Context *sha256ctxp) |
Hash initialization using SHA256. | |
cryerror_t | crySHA256Update (CRYDriver *cryp, SHA256Context *sha256ctxp, size_t size, const uint8_t *in) |
Hash update using SHA256. | |
cryerror_t | crySHA256Final (CRYDriver *cryp, SHA256Context *sha256ctxp, uint8_t *out) |
Hash finalization using SHA256. | |
cryerror_t | crySHA512Init (CRYDriver *cryp, SHA512Context *sha512ctxp) |
Hash initialization using SHA512. | |
cryerror_t | crySHA512Update (CRYDriver *cryp, SHA512Context *sha512ctxp, size_t size, const uint8_t *in) |
Hash update using SHA512. | |
cryerror_t | crySHA512Final (CRYDriver *cryp, SHA512Context *sha512ctxp, uint8_t *out) |
Hash finalization using SHA512. | |
cryerror_t | cryLoadHMACTransientKey (CRYDriver *cryp, size_t size, const uint8_t *keyp) |
Initializes the HMAC transient key. | |
cryerror_t | cryHMACSHA256Init (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp) |
Hash initialization using HMAC_SHA256. | |
cryerror_t | cryHMACSHA256Update (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp, size_t size, const uint8_t *in) |
Hash update using HMAC. | |
cryerror_t | cryHMACSHA256Final (CRYDriver *cryp, HMACSHA256Context *hmacsha256ctxp, uint8_t *out) |
Hash finalization using HMAC. | |
cryerror_t | cryHMACSHA512Init (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp) |
Hash initialization using HMAC_SHA512. | |
cryerror_t | cryHMACSHA512Update (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp, size_t size, const uint8_t *in) |
Hash update using HMAC. | |
cryerror_t | cryHMACSHA512Final (CRYDriver *cryp, HMACSHA512Context *hmacsha512ctxp, uint8_t *out) |
Hash finalization using HMAC. |
Cryptographic Driver macros and structures.
Definition in file hal_crypto.h.