22 #ifndef TI_PSA_CRYPTO_MAC_H 23 #define TI_PSA_CRYPTO_MAC_H 28 #if ((TFM_ENABLED == 1) && !defined(TFM_BUILD)) 29 #include <third_party/tfm/interface/include/psa/crypto.h> 31 #include <third_party/mbedtls/include/psa/crypto.h> 34 #include <ti/devices/DeviceFamily.h> 35 #if ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)) 38 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 39 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 40 #include <ti/drivers/sha2/SHA2CC26X2.h> 41 #include <ti/drivers/aescmac/AESCMACCC26XX.h> 51 #if ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)) 53 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 54 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 61 #if ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)) 63 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 64 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 71 #if ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)) 73 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 74 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 96 uint8_t
unprocessedData[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE * 2] __attribute__((aligned(4)));
98 uint8_t
unprocessedData[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE] __attribute__((aligned(4)));
110 #define TI_PSA_MAC_OPERATION_INIT \ 111 (ti_psa_mac_operation_t) \ 132 psa_status_t
ti_psa_mac_sign_setup(psa_mac_operation_t *psa_operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg);
134 psa_status_t
ti_psa_mac_update(psa_mac_operation_t *psa_operation,
const uint8_t *input,
size_t input_length);
138 psa_status_t
ti_psa_mac_verify_setup(psa_mac_operation_t *psa_operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg);
145 const uint8_t *input,
153 const uint8_t *input,
psa_status_t ti_psa_mac_abort(psa_mac_operation_t *psa_operation)
The CryptoKey type is an opaque representation of a cryptographic key.
struct ti_psa_mac_operation_s::@8::@11 aescbcmac
psa_status_t ti_psa_mac_sign_setup(psa_mac_operation_t *psa_operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
AES Global configuration.
Definition: AESCommon.h:154
union ti_psa_mac_operation_s::@8 driver
CryptoKey cryptoKey
Definition: ti_psa_crypto_mac.h:104
psa_status_t ti_psa_mac_verify_finish(psa_mac_operation_t *psa_operation, const uint8_t *mac, size_t mac_length)
SHA2 Global configuration.
Definition: SHA2.h:553
CryptoKey datastructure.
Definition: CryptoKey.h:211
struct ti_psa_mac_operation_s::@8::@10 aescmac
AESCMACXXF3_Object aescmacObject
Definition: ti_psa_crypto_mac.h:62
unsigned int id
Definition: ti_psa_crypto_mac.h:85
SHA2XXF3HSM_Object sha2Object
Definition: ti_psa_crypto_mac.h:52
uint8_t * curr_unprocessed_data
Definition: ti_psa_crypto_mac.h:102
psa_status_t ti_psa_mac_compute(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *mac, size_t mac_size, size_t *mac_length)
uint8_t unprocessedData[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE]
Definition: ti_psa_crypto_mac.h:98
SHA2_Config sha2Config
Definition: ti_psa_crypto_mac.h:50
AESCMAC_Config aescbcmacConfig
Definition: ti_psa_crypto_mac.h:70
size_t mac_size
Definition: ti_psa_crypto_mac.h:86
size_t unprocessed_len
Definition: ti_psa_crypto_mac.h:88
Definition: ti_psa_crypto_mac.h:44
bool is_sign
Definition: ti_psa_crypto_mac.h:105
static struct ti_psa_mac_operation_s ti_psa_mac_operation_init(void)
Definition: ti_psa_crypto_mac.h:116
struct ti_psa_mac_operation_s::@8::@9 sha2
psa_status_t ti_psa_mac_verify(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *mac, size_t mac_length)
#define TI_PSA_MAC_OPERATION_INIT
Definition: ti_psa_crypto_mac.h:110
psa_status_t ti_psa_mac_update(psa_mac_operation_t *psa_operation, const uint8_t *input, size_t input_length)
AESCMACXXF3_Object aescbcmacObject
Definition: ti_psa_crypto_mac.h:72
psa_algorithm_t alg
Definition: ti_psa_crypto_mac.h:87
AESCMAC_Config aescmacConfig
Definition: ti_psa_crypto_mac.h:60
AESCMACXXF3 Object.
Definition: AESCMACXXF3.h:128
psa_status_t ti_psa_mac_sign_finish(psa_mac_operation_t *psa_operation, uint8_t *mac, size_t mac_size, size_t *mac_length)
psa_status_t ti_psa_mac_verify_setup(psa_mac_operation_t *psa_operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
AESCMAC (CMAC & CBC-MAC) driver implementation for the Low Power F3 family.