22 #ifndef TI_PSA_CRYPTO_CIPHER_H 23 #define TI_PSA_CRYPTO_CIPHER_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)) 39 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 40 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 41 #include <ti/drivers/aesecb/AESECBCC26XX.h> 42 #include <ti/drivers/aescbc/AESCBCCC26XX.h> 43 #include <ti/drivers/aesctr/AESCTRCC26XX.h> 52 #if ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)) 54 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 55 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 62 #if ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)) 64 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 65 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 72 #if ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)) 74 #elif ((DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2) || \ 75 (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)) 99 uint8_t
unprocessed_data[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE * 2] __attribute__((aligned(4)));
112 #define TI_PSA_CIPHER_OPERATION_INIT \ 113 (ti_psa_cipher_operation_t) \ 132 mbedtls_svc_key_id_t key,
133 psa_algorithm_t alg);
136 mbedtls_svc_key_id_t key,
137 psa_algorithm_t alg);
144 psa_status_t
ti_psa_cipher_set_iv(psa_cipher_operation_t *psa_operation,
const uint8_t *iv,
size_t iv_length);
148 const uint8_t *input,
152 size_t *output_length);
156 const uint8_t *input,
160 size_t *output_length);
163 const uint8_t *input,
167 size_t *output_length);
172 size_t *output_length);
AESCBCXXF3_Object aescbcObject
Definition: ti_psa_crypto_cipher.h:63
The CryptoKey type is an opaque representation of a cryptographic key.
AESCBCXXF3 Object.
Definition: AESCBCXXF3.h:90
psa_status_t ti_psa_cipher_encrypt_setup(psa_cipher_operation_t *psa_operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
psa_status_t ti_psa_cipher_encrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
AESECB_Config aesecbConfig
Definition: ti_psa_crypto_cipher.h:51
unsigned int iv_required
Definition: ti_psa_crypto_cipher.h:83
struct ti_psa_cipher_operation_s::@4::@7 aesctr
AES Global configuration.
Definition: AESCommon.h:154
unsigned int in_error_state
Definition: ti_psa_crypto_cipher.h:86
CryptoKey datastructure.
Definition: CryptoKey.h:211
AESCTRXXF3_Object aesctrObject
Definition: ti_psa_crypto_cipher.h:73
union ti_psa_cipher_operation_s::@4 driver
psa_status_t ti_psa_generate_random(uint8_t *output, size_t output_size)
psa_algorithm_t alg
Definition: ti_psa_crypto_cipher.h:88
AESCBC_Config aescbcConfig
Definition: ti_psa_crypto_cipher.h:61
struct ti_psa_cipher_operation_s::@4::@6 aescbc
psa_status_t ti_psa_cipher_generate_iv(psa_cipher_operation_t *psa_operation, uint8_t *iv, size_t iv_size, size_t *iv_length)
CryptoKey cryptoKey
Definition: ti_psa_crypto_cipher.h:107
AESCTR driver implementation for the Low Power F3 family.
unsigned int is_encrypt
Definition: ti_psa_crypto_cipher.h:85
psa_status_t ti_psa_cipher_abort(psa_cipher_operation_t *psa_operation)
AESECBXXF3_Object aesecbObject
Definition: ti_psa_crypto_cipher.h:53
uint8_t * curr_unprocessed_data
Definition: ti_psa_crypto_cipher.h:105
psa_status_t ti_psa_cipher_decrypt_setup(psa_cipher_operation_t *psa_operation, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
static struct ti_psa_cipher_operation_s ti_psa_cipher_operation_init(void)
Definition: ti_psa_crypto_cipher.h:117
AESCTRXXF3 Object.
Definition: AESCTRXXF3.h:134
psa_status_t ti_psa_cipher_finish(psa_cipher_operation_t *psa_operation, uint8_t *output, size_t output_size, size_t *output_length)
AESECB driver implementation for the Low Power F3 family.
psa_status_t ti_psa_cipher_set_iv(psa_cipher_operation_t *psa_operation, const uint8_t *iv, size_t iv_length)
Definition: ti_psa_crypto_cipher.h:45
size_t unprocessed_len
Definition: ti_psa_crypto_cipher.h:91
#define TI_PSA_CIPHER_OPERATION_INIT
Definition: ti_psa_crypto_cipher.h:112
AESCTR_Config aesctrConfig
Definition: ti_psa_crypto_cipher.h:71
unsigned int id
Definition: ti_psa_crypto_cipher.h:82
size_t default_iv_length
Definition: ti_psa_crypto_cipher.h:87
struct ti_psa_cipher_operation_s::@4::@5 aesecb
psa_status_t ti_psa_cipher_decrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
psa_status_t ti_psa_cipher_update(psa_cipher_operation_t *psa_operation, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
AESCBC driver implementation for the Low Power F3 devices.
AESECBXXF3 Object.
Definition: AESECBXXF3.h:109
uint8_t unprocessed_data[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE]
Definition: ti_psa_crypto_cipher.h:101
unsigned int iv_set
Definition: ti_psa_crypto_cipher.h:84