From 83d2662dfa5f868bb19f8f8a9088eb9fe44d0bc5 Mon Sep 17 00:00:00 2001 From: Derek Miller Date: Fri, 15 Feb 2019 16:41:22 -0600 Subject: [PATCH] Changed opaque/transparent in functions/structs to se/accel --- include/psa/crypto_accel_driver.h | 212 ++++++++++---------- include/psa/crypto_se_driver.h | 322 +++++++++++++++--------------- 2 files changed, 267 insertions(+), 267 deletions(-) diff --git a/include/psa/crypto_accel_driver.h b/include/psa/crypto_accel_driver.h index b752fed88..72187152b 100644 --- a/include/psa/crypto_accel_driver.h +++ b/include/psa/crypto_accel_driver.h @@ -168,7 +168,7 @@ typedef void (*psa_drv_hash_abort_t)(psa_drv_hash_context_t *p_context); * The contents of this structure are implementation dependent and are * therefore not described here. */ -typedef struct psa_drv_mac_transparent_context_s psa_drv_mac_transparent_context_t; +typedef struct psa_drv_accel_mac_context_s psa_drv_accel_mac_context_t; /** \brief The function prototype for the setup operation of a * transparent-key MAC operation @@ -190,9 +190,9 @@ typedef struct psa_drv_mac_transparent_context_s psa_drv_mac_transparent_context * \retval PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_mac_transparent_setup_t)(psa_drv_mac_transparent_context_t *p_context, - const uint8_t *p_key, - size_t key_length); +typedef psa_status_t (*psa_drv_accel_mac_setup_t)(psa_drv_accel_mac_context_t *p_context, + const uint8_t *p_key, + size_t key_length); /** \brief The function prototype for the update operation of a * transparent-key MAC operation @@ -212,9 +212,9 @@ typedef psa_status_t (*psa_drv_mac_transparent_setup_t)(psa_drv_mac_transparent_ * to the MAC operation * \param[in] input_length The size in bytes of the input message buffer */ -typedef psa_status_t (*psa_drv_mac_transparent_update_t)(psa_drv_mac_transparent_context_t *p_context, - const uint8_t *p_input, - size_t input_length); +typedef psa_status_t (*psa_drv_accel_mac_update_t)(psa_drv_accel_mac_context_t *p_context, + const uint8_t *p_input, + size_t input_length); /** \brief The function prototype for the finish operation of a * transparent-key MAC operation @@ -237,9 +237,9 @@ typedef psa_status_t (*psa_drv_mac_transparent_update_t)(psa_drv_mac_transparent * \retval PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_mac_transparent_finish_t)(psa_drv_mac_transparent_context_t *p_context, - uint8_t *p_mac, - size_t mac_length); +typedef psa_status_t (*psa_drv_accel_mac_finish_t)(psa_drv_accel_mac_context_t *p_context, + uint8_t *p_mac, + size_t mac_length); /** \brief The function prototype for the finish and verify operation of a * transparent-key MAC operation @@ -263,9 +263,9 @@ typedef psa_status_t (*psa_drv_mac_transparent_finish_t)(psa_drv_mac_transparent * \retval PSA_SUCCESS * The operation completed successfully and the comparison matched */ -typedef psa_status_t (*psa_drv_mac_transparent_finish_verify_t)(psa_drv_mac_transparent_context_t *p_context, - const uint8_t *p_mac, - size_t mac_length); +typedef psa_status_t (*psa_drv_accel_mac_finish_verify_t)(psa_drv_accel_mac_context_t *p_context, + const uint8_t *p_mac, + size_t mac_length); /** \brief The function prototype for the abort operation for a previously * started transparent-key MAC operation @@ -283,7 +283,7 @@ typedef psa_status_t (*psa_drv_mac_transparent_finish_verify_t)(psa_drv_mac_tran * aborted * */ -typedef psa_status_t (*psa_drv_mac_transparent_abort_t)(psa_drv_mac_transparent_context_t *p_context); +typedef psa_status_t (*psa_drv_accel_mac_abort_t)(psa_drv_accel_mac_context_t *p_context); /** \brief The function prototype for a one-shot operation of a transparent-key * MAC operation @@ -306,13 +306,13 @@ typedef psa_status_t (*psa_drv_mac_transparent_abort_t)(psa_drv_mac_transparent_ * upon success * \param[in] mac_length The length in bytes of the `p_mac` buffer */ -typedef psa_status_t (*psa_drv_mac_transparent_t)(const uint8_t *p_input, - size_t input_length, - const uint8_t *p_key, - size_t key_length, - psa_algorithm_t alg, - uint8_t *p_mac, - size_t mac_length); +typedef psa_status_t (*psa_drv_accel_mac_t)(const uint8_t *p_input, + size_t input_length, + const uint8_t *p_key, + size_t key_length, + psa_algorithm_t alg, + uint8_t *p_mac, + size_t mac_length); /** \brief The function prototype for a one-shot operation of a transparent-key * MAC Verify operation @@ -337,13 +337,13 @@ typedef psa_status_t (*psa_drv_mac_transparent_t)(const uint8_t *p_input, * \retval PSA_SUCCESS * The operation completed successfully and the comparison matched */ -typedef psa_status_t (*psa_drv_mac_transparent_verify_t)(const uint8_t *p_input, - size_t input_length, - const uint8_t *p_key, - size_t key_length, - psa_algorithm_t alg, - const uint8_t *p_mac, - size_t mac_length); +typedef psa_status_t (*psa_drv_accel_mac_verify_t)(const uint8_t *p_input, + size_t input_length, + const uint8_t *p_key, + size_t key_length, + psa_algorithm_t alg, + const uint8_t *p_mac, + size_t mac_length); /**@}*/ /** \defgroup transparent_cipher Transparent Block Cipher @@ -367,7 +367,7 @@ typedef psa_status_t (*psa_drv_mac_transparent_verify_t)(const uint8_t *p_input, * The contents of this structure are implementation dependent and are * therefore not described here. */ -typedef struct psa_drv_cipher_transparent_context_s psa_drv_cipher_transparent_context_t; +typedef struct psa_drv_accel_cipher_context_s psa_drv_accel_cipher_context_t; /** \brief The function prototype for the setup operation of transparent-key * block cipher operations. @@ -395,10 +395,10 @@ typedef struct psa_drv_cipher_transparent_context_s psa_drv_cipher_transparent_c * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_transparent_setup_t)(psa_drv_cipher_transparent_context_t *p_context, - psa_encrypt_or_decrypt_t direction, - const uint8_t *p_key_data, - size_t key_data_size); +typedef psa_status_t (*psa_drv_accel_cipher_setup_t)(psa_drv_accel_cipher_context_t *p_context, + psa_encrypt_or_decrypt_t direction, + const uint8_t *p_key_data, + size_t key_data_size); /** \brief The function prototype for the set initialization vector operation * of transparent-key block cipher operations @@ -418,9 +418,9 @@ typedef psa_status_t (*psa_drv_cipher_transparent_setup_t)(psa_drv_cipher_transp * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_transparent_set_iv_t)(psa_drv_cipher_transparent_context_t *p_context, - const uint8_t *p_iv, - size_t iv_length); +typedef psa_status_t (*psa_drv_accel_cipher_set_iv_t)(psa_drv_accel_cipher_context_t *p_context, + const uint8_t *p_iv, + size_t iv_length); /** \brief The function prototype for the update operation of transparent-key * block cipher operations. @@ -447,12 +447,12 @@ typedef psa_status_t (*psa_drv_cipher_transparent_set_iv_t)(psa_drv_cipher_trans * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_transparent_update_t)(psa_drv_cipher_transparent_context_t *p_context, - const uint8_t *p_input, - size_t input_size, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_accel_cipher_update_t)(psa_drv_accel_cipher_context_t *p_context, + const uint8_t *p_input, + size_t input_size, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /** \brief The function prototype for the finish operation of transparent-key * block cipher operations. @@ -476,10 +476,10 @@ typedef psa_status_t (*psa_drv_cipher_transparent_update_t)(psa_drv_cipher_trans * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_transparent_finish_t)(psa_drv_cipher_transparent_context_t *p_context, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_accel_cipher_finish_t)(psa_drv_accel_cipher_context_t *p_context, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /** \brief The function prototype for the abort operation of transparent-key * block cipher operations. @@ -498,7 +498,7 @@ typedef psa_status_t (*psa_drv_cipher_transparent_finish_t)(psa_drv_cipher_trans * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_transparent_abort_t)(psa_drv_cipher_transparent_context_t *p_context); +typedef psa_status_t (*psa_drv_accel_cipher_abort_t)(psa_drv_accel_cipher_context_t *p_context); /**@}*/ @@ -553,18 +553,18 @@ typedef psa_status_t (*psa_drv_cipher_transparent_abort_t)(psa_drv_cipher_transp * \retval #PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_aead_transparent_encrypt_t)(const uint8_t *p_key, - size_t key_length, - psa_algorithm_t alg, - const uint8_t *nonce, - size_t nonce_length, - const uint8_t *additional_data, - size_t additional_data_length, - const uint8_t *plaintext, - size_t plaintext_length, - uint8_t *ciphertext, - size_t ciphertext_size, - size_t *ciphertext_length); +typedef psa_status_t (*psa_drv_accel_aead_encrypt_t)(const uint8_t *p_key, + size_t key_length, + psa_algorithm_t alg, + const uint8_t *nonce, + size_t nonce_length, + const uint8_t *additional_data, + size_t additional_data_length, + const uint8_t *plaintext, + size_t plaintext_length, + uint8_t *ciphertext, + size_t ciphertext_size, + size_t *ciphertext_length); /** Process an authenticated decryption operation using an opaque key. * @@ -604,18 +604,18 @@ typedef psa_status_t (*psa_drv_aead_transparent_encrypt_t)(const uint8_t *p_key, * \retval #PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_aead_transparent_decrypt_t)(const uint8_t *p_key, - size_t key_length, - psa_algorithm_t alg, - const uint8_t *nonce, - size_t nonce_length, - const uint8_t *additional_data, - size_t additional_data_length, - const uint8_t *ciphertext, - size_t ciphertext_length, - uint8_t *plaintext, - size_t plaintext_size, - size_t *plaintext_length); +typedef psa_status_t (*psa_drv_accel_aead_decrypt_t)(const uint8_t *p_key, + size_t key_length, + psa_algorithm_t alg, + const uint8_t *nonce, + size_t nonce_length, + const uint8_t *additional_data, + size_t additional_data_length, + const uint8_t *ciphertext, + size_t ciphertext_length, + uint8_t *plaintext, + size_t plaintext_size, + size_t *plaintext_length); /**@}*/ @@ -653,14 +653,14 @@ typedef psa_status_t (*psa_drv_aead_transparent_decrypt_t)(const uint8_t *p_key, * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_asymmetric_transparent_sign_t)(const uint8_t *p_key, - size_t key_size, - psa_algorithm_t alg, - const uint8_t *p_hash, - size_t hash_length, - uint8_t *p_signature, - size_t signature_size, - size_t *p_signature_length); +typedef psa_status_t (*psa_drv_accel_asymmetric_sign_t)(const uint8_t *p_key, + size_t key_size, + psa_algorithm_t alg, + const uint8_t *p_hash, + size_t hash_length, + uint8_t *p_signature, + size_t signature_size, + size_t *p_signature_length); /** * \brief A function that verifies the signature a hash or short message using @@ -686,13 +686,13 @@ typedef psa_status_t (*psa_drv_asymmetric_transparent_sign_t)(const uint8_t *p_k * \retval PSA_SUCCESS * The signature is valid. */ -typedef psa_status_t (*psa_drv_asymmetric_transparent_verify_t)(const uint8_t *p_key, - size_t key_size, - psa_algorithm_t alg, - const uint8_t *p_hash, - size_t hash_length, - const uint8_t *p_signature, - size_t signature_length); +typedef psa_status_t (*psa_drv_accel_asymmetric_verify_t)(const uint8_t *p_key, + size_t key_size, + psa_algorithm_t alg, + const uint8_t *p_hash, + size_t hash_length, + const uint8_t *p_signature, + size_t signature_length); /** * \brief A function that encrypts a short message with a transparent @@ -730,16 +730,16 @@ typedef psa_status_t (*psa_drv_asymmetric_transparent_verify_t)(const uint8_t *p * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_asymmetric_transparent_encrypt_t)(const uint8_t *p_key, - size_t key_size, - psa_algorithm_t alg, - const uint8_t *p_input, - size_t input_length, - const uint8_t *p_salt, - size_t salt_length, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_accel_asymmetric_encrypt_t)(const uint8_t *p_key, + size_t key_size, + psa_algorithm_t alg, + const uint8_t *p_input, + size_t input_length, + const uint8_t *p_salt, + size_t salt_length, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /** * \brief Decrypt a short message with a transparent asymmetric private key @@ -776,16 +776,16 @@ typedef psa_status_t (*psa_drv_asymmetric_transparent_encrypt_t)(const uint8_t * * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_asymmetric_transparent_decrypt_t)(const uint8_t *p_key, - size_t key_size, - psa_algorithm_t alg, - const uint8_t *p_input, - size_t input_length, - const uint8_t *p_salt, - size_t salt_length, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_accel_asymmetric_decrypt_t)(const uint8_t *p_key, + size_t key_size, + psa_algorithm_t alg, + const uint8_t *p_input, + size_t input_length, + const uint8_t *p_salt, + size_t salt_length, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /**@}*/ diff --git a/include/psa/crypto_se_driver.h b/include/psa/crypto_se_driver.h index 057866445..7ca6d605a 100644 --- a/include/psa/crypto_se_driver.h +++ b/include/psa/crypto_se_driver.h @@ -75,9 +75,9 @@ typedef uint32_t psa_key_slot_t; * \retval PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_mac_opaque_setup_t)(void *p_context, - psa_key_slot_t key_slot, - psa_algorithm_t algorithm); +typedef psa_status_t (*psa_drv_se_mac_setup_t)(void *p_context, + psa_key_slot_t key_slot, + psa_algorithm_t algorithm); /** \brief A function that continues a previously started MAC operation using * an opaque key @@ -89,9 +89,9 @@ typedef psa_status_t (*psa_drv_mac_opaque_setup_t)(void *p_context, * to the MAC operation * \param[in] input_length The size in bytes of the input message buffer */ -typedef psa_status_t (*psa_drv_mac_opaque_update_t)(void *p_context, - const uint8_t *p_input, - size_t input_length); +typedef psa_status_t (*psa_drv_se_mac_update_t)(void *p_context, + const uint8_t *p_input, + size_t input_length); /** \brief a function that completes a previously started MAC operation by * returning the resulting MAC using an opaque key @@ -109,10 +109,10 @@ typedef psa_status_t (*psa_drv_mac_opaque_update_t)(void *p_context, * \retval PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_mac_opaque_finish_t)(void *p_context, - uint8_t *p_mac, - size_t mac_size, - size_t *p_mac_length); +typedef psa_status_t (*psa_drv_se_mac_finish_t)(void *p_context, + uint8_t *p_mac, + size_t mac_size, + size_t *p_mac_length); /** \brief A function that completes a previously started MAC operation by * comparing the resulting MAC against a known value using an opaque key @@ -130,16 +130,16 @@ typedef psa_status_t (*psa_drv_mac_opaque_finish_t)(void *p_context, * The operation completed successfully, but the calculated MAC did * not match the provided MAC */ -typedef psa_status_t (*psa_drv_mac_opaque_finish_verify_t)(void *p_context, - const uint8_t *p_mac, - size_t mac_length); +typedef psa_status_t (*psa_drv_se_mac_finish_verify_t)(void *p_context, + const uint8_t *p_mac, + size_t mac_length); /** \brief A function that aborts a previous started opaque-key MAC operation * \param[in,out] p_context A hardware-specific structure for the previously * started MAC operation to be aborted */ -typedef psa_status_t (*psa_drv_mac_opaque_abort_t)(void *p_context); +typedef psa_status_t (*psa_drv_se_mac_abort_t)(void *p_context); /** \brief A function that performs a MAC operation in one command and returns * the calculated MAC using an opaque key @@ -158,13 +158,13 @@ typedef psa_status_t (*psa_drv_mac_opaque_abort_t)(void *p_context); * \retval PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_mac_opaque_generate_t)(const uint8_t *p_input, - size_t input_length, - psa_key_slot_t key_slot, - psa_algorithm_t alg, - uint8_t *p_mac, - size_t mac_size, - size_t *p_mac_length); +typedef psa_status_t (*psa_drv_se_mac_generate_t)(const uint8_t *p_input, + size_t input_length, + psa_key_slot_t key_slot, + psa_algorithm_t alg, + uint8_t *p_mac, + size_t mac_size, + size_t *p_mac_length); /** \brief A function that performs an MAC operation in one command and * compare the resulting MAC against a known value using an opaque key @@ -185,12 +185,12 @@ typedef psa_status_t (*psa_drv_mac_opaque_generate_t)(const uint8_t *p_input, * The operation completed successfully, but the calculated MAC did * not match the provided MAC */ -typedef psa_status_t (*psa_drv_mac_opaque_verify_t)(const uint8_t *p_input, - size_t input_length, - psa_key_slot_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_mac, - size_t mac_length); +typedef psa_status_t (*psa_drv_se_mac_verify_t)(const uint8_t *p_input, + size_t input_length, + psa_key_slot_t key_slot, + psa_algorithm_t alg, + const uint8_t *p_mac, + size_t mac_length); /** \brief A struct containing all of the function pointers needed to * implement MAC operations using opaque keys. @@ -213,26 +213,26 @@ typedef struct { size_t context_size; /** Function that performs the setup operation */ - psa_drv_mac_opaque_setup_t *p_setup; - /** Function that performs the update operation + psa_drv_se_mac_setup_t *p_setup; + /** Function that performs the update operation */ - psa_drv_mac_opaque_update_t *p_update; + psa_drv_se_mac_update_t *p_update; /** Function that completes the operation */ - psa_drv_mac_opaque_finish_t *p_finish; + psa_drv_se_mac_finish_t *p_finish; /** Function that completed a MAC operation with a verify check */ - psa_drv_mac_opaque_finish_verify_t *p_finish_verify; + psa_drv_se_mac_finish_verify_t *p_finish_verify; /** Function that aborts a previoustly started operation */ - psa_drv_mac_opaque_abort_t *p_abort; + psa_drv_se_mac_abort_t *p_abort; /** Function that performs the MAC operation in one call */ - psa_drv_mac_opaque_generate_t *p_mac; + psa_drv_se_mac_generate_t *p_mac; /** Function that performs the MAC and verify operation in one call */ - psa_drv_mac_opaque_verify_t *p_mac_verify; -} psa_drv_mac_opaque_t; + psa_drv_se_mac_verify_t *p_mac_verify; +} psa_drv_se_mac_t; /**@}*/ /** \defgroup opaque_cipher Opaque Symmetric Ciphers @@ -272,10 +272,10 @@ typedef struct { * \retval PSA_SUCCESS * \retval PSA_ERROR_NOT_SUPPORTED */ -typedef psa_status_t (*psa_drv_cipher_opaque_setup_t)(void *p_context, - psa_key_slot_t key_slot, - psa_algorithm_t algorithm, - psa_encrypt_or_decrypt_t direction); +typedef psa_status_t (*psa_drv_se_cipher_setup_t)(void *p_context, + psa_key_slot_t key_slot, + psa_algorithm_t algorithm, + psa_encrypt_or_decrypt_t direction); /** \brief A function pointer that sets the initialization vector (if * necessary) for an opaque cipher operation @@ -292,9 +292,9 @@ typedef psa_status_t (*psa_drv_cipher_opaque_setup_t)(void *p_context, * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_opaque_set_iv_t)(void *p_context, - const uint8_t *p_iv, - size_t iv_length); +typedef psa_status_t (*psa_drv_se_cipher_set_iv_t)(void *p_context, + const uint8_t *p_iv, + size_t iv_length); /** \brief A function that continues a previously started opaque-key cipher * operation @@ -314,12 +314,12 @@ typedef psa_status_t (*psa_drv_cipher_opaque_set_iv_t)(void *p_context, * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_opaque_update_t)(void *p_context, - const uint8_t *p_input, - size_t input_size, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_se_cipher_update_t)(void *p_context, + const uint8_t *p_input, + size_t input_size, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /** \brief A function that completes a previously started opaque-key cipher * operation @@ -335,10 +335,10 @@ typedef psa_status_t (*psa_drv_cipher_opaque_update_t)(void *p_context, * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_cipher_opaque_finish_t)(void *p_context, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_se_cipher_finish_t)(void *p_context, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /** \brief A function that aborts a previously started opaque-key cipher * operation @@ -346,7 +346,7 @@ typedef psa_status_t (*psa_drv_cipher_opaque_finish_t)(void *p_context, * \param[in,out] p_context A hardware-specific structure for the * previously started cipher operation */ -typedef psa_status_t (*psa_drv_cipher_opaque_abort_t)(void *p_context); +typedef psa_status_t (*psa_drv_se_cipher_abort_t)(void *p_context); /** \brief A function that performs the ECB block mode for opaque-key cipher * operations @@ -370,13 +370,13 @@ typedef psa_status_t (*psa_drv_cipher_opaque_abort_t)(void *p_context); * \retval PSA_SUCCESS * \retval PSA_ERROR_NOT_SUPPORTED */ -typedef psa_status_t (*psa_drv_cipher_opaque_ecb_t)(psa_key_slot_t key_slot, - psa_algorithm_t algorithm, - psa_encrypt_or_decrypt_t direction, - const uint8_t *p_input, - size_t input_size, - uint8_t *p_output, - size_t output_size); +typedef psa_status_t (*psa_drv_se_cipher_ecb_t)(psa_key_slot_t key_slot, + psa_algorithm_t algorithm, + psa_encrypt_or_decrypt_t direction, + const uint8_t *p_input, + size_t input_size, + uint8_t *p_output, + size_t output_size); /** * \brief A struct containing all of the function pointers needed to implement @@ -392,23 +392,23 @@ typedef struct { /** The size in bytes of the hardware-specific Opaque Cipher context * structure */ - size_t size; + size_t size; /** Function that performs the setup operation */ - psa_drv_cipher_opaque_setup_t *p_setup; + psa_drv_se_cipher_setup_t *p_setup; /** Function that sets the IV (if necessary) */ - psa_drv_cipher_opaque_set_iv_t *p_set_iv; + psa_drv_se_cipher_set_iv_t *p_set_iv; /** Function that performs the update operation */ - psa_drv_cipher_opaque_update_t *p_update; + psa_drv_se_cipher_update_t *p_update; /** Function that completes the operation */ - psa_drv_cipher_opaque_finish_t *p_finish; + psa_drv_se_cipher_finish_t *p_finish; /** Function that aborts the operation */ - psa_drv_cipher_opaque_abort_t *p_abort; + psa_drv_se_cipher_abort_t *p_abort; /** Function that performs ECB mode for the cipher * (Danger: ECB mode should not be used directly by clients of the PSA * Crypto Client API) */ - psa_drv_cipher_opaque_ecb_t *p_ecb; -} psa_drv_cipher_opaque_t; + psa_drv_se_cipher_ecb_t *p_ecb; +} psa_drv_se_cipher_t; /**@}*/ @@ -435,13 +435,13 @@ typedef struct { * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_asymmetric_opaque_sign_t)(psa_key_slot_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_hash, - size_t hash_length, - uint8_t *p_signature, - size_t signature_size, - size_t *p_signature_length); +typedef psa_status_t (*psa_drv_se_asymmetric_sign_t)(psa_key_slot_t key_slot, + psa_algorithm_t alg, + const uint8_t *p_hash, + size_t hash_length, + uint8_t *p_signature, + size_t signature_size, + size_t *p_signature_length); /** * \brief A function that verifies the signature a hash or short message using @@ -459,12 +459,12 @@ typedef psa_status_t (*psa_drv_asymmetric_opaque_sign_t)(psa_key_slot_t key_slot * \retval PSA_SUCCESS * The signature is valid. */ -typedef psa_status_t (*psa_drv_asymmetric_opaque_verify_t)(psa_key_slot_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_hash, - size_t hash_length, - const uint8_t *p_signature, - size_t signature_length); +typedef psa_status_t (*psa_drv_se_asymmetric_verify_t)(psa_key_slot_t key_slot, + psa_algorithm_t alg, + const uint8_t *p_hash, + size_t hash_length, + const uint8_t *p_signature, + size_t signature_length); /** * \brief A function that encrypts a short message with an asymmetric public @@ -495,15 +495,15 @@ typedef psa_status_t (*psa_drv_asymmetric_opaque_verify_t)(psa_key_slot_t key_sl * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_asymmetric_opaque_encrypt_t)(psa_key_slot_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_input, - size_t input_length, - const uint8_t *p_salt, - size_t salt_length, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_se_asymmetric_encrypt_t)(psa_key_slot_t key_slot, + psa_algorithm_t alg, + const uint8_t *p_input, + size_t input_length, + const uint8_t *p_salt, + size_t salt_length, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /** * \brief Decrypt a short message with an asymmetric private key. @@ -532,15 +532,15 @@ typedef psa_status_t (*psa_drv_asymmetric_opaque_encrypt_t)(psa_key_slot_t key_s * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_asymmetric_opaque_decrypt_t)(psa_key_slot_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_input, - size_t input_length, - const uint8_t *p_salt, - size_t salt_length, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); +typedef psa_status_t (*psa_drv_se_asymmetric_decrypt_t)(psa_key_slot_t key_slot, + psa_algorithm_t alg, + const uint8_t *p_input, + size_t input_length, + const uint8_t *p_salt, + size_t salt_length, + uint8_t *p_output, + size_t output_size, + size_t *p_output_length); /** * \brief A struct containing all of the function pointers needed to implement @@ -553,14 +553,14 @@ typedef psa_status_t (*psa_drv_asymmetric_opaque_decrypt_t)(psa_key_slot_t key_s */ typedef struct { /** Function that performs the asymmetric sign operation */ - psa_drv_asymmetric_opaque_sign_t *p_sign; + psa_drv_se_asymmetric_sign_t *p_sign; /** Function that performs the asymmetric verify operation */ - psa_drv_asymmetric_opaque_verify_t *p_verify; + psa_drv_se_asymmetric_verify_t *p_verify; /** Function that performs the asymmetric encrypt operation */ - psa_drv_asymmetric_opaque_encrypt_t *p_encrypt; + psa_drv_se_asymmetric_encrypt_t *p_encrypt; /** Function that performs the asymmetric decrypt operation */ - psa_drv_asymmetric_opaque_decrypt_t *p_decrypt; -} psa_drv_asymmetric_opaque_t; + psa_drv_se_asymmetric_decrypt_t *p_decrypt; +} psa_drv_se_asymmetric_t; /**@}*/ @@ -602,17 +602,17 @@ typedef struct { * \retval #PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_aead_opaque_encrypt_t)(psa_key_slot_t key_slot, - psa_algorithm_t algorithm, - const uint8_t *p_nonce, - size_t nonce_length, - const uint8_t *p_additional_data, - size_t additional_data_length, - const uint8_t *p_plaintext, - size_t plaintext_length, - uint8_t *p_ciphertext, - size_t ciphertext_size, - size_t *p_ciphertext_length); +typedef psa_status_t (*psa_drv_se_aead_encrypt_t)(psa_key_slot_t key_slot, + psa_algorithm_t algorithm, + const uint8_t *p_nonce, + size_t nonce_length, + const uint8_t *p_additional_data, + size_t additional_data_length, + const uint8_t *p_plaintext, + size_t plaintext_length, + uint8_t *p_ciphertext, + size_t ciphertext_size, + size_t *p_ciphertext_length); /** Process an authenticated decryption operation using an opaque key * @@ -642,17 +642,17 @@ typedef psa_status_t (*psa_drv_aead_opaque_encrypt_t)(psa_key_slot_t key_slot, * \retval #PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_aead_opaque_decrypt_t)(psa_key_slot_t key_slot, - psa_algorithm_t algorithm, - const uint8_t *p_nonce, - size_t nonce_length, - const uint8_t *p_additional_data, - size_t additional_data_length, - const uint8_t *p_ciphertext, - size_t ciphertext_length, - uint8_t *p_plaintext, - size_t plaintext_size, - size_t *p_plaintext_length); +typedef psa_status_t (*psa_drv_se_aead_decrypt_t)(psa_key_slot_t key_slot, + psa_algorithm_t algorithm, + const uint8_t *p_nonce, + size_t nonce_length, + const uint8_t *p_additional_data, + size_t additional_data_length, + const uint8_t *p_ciphertext, + size_t ciphertext_length, + uint8_t *p_plaintext, + size_t plaintext_size, + size_t *p_plaintext_length); /** * \brief A struct containing all of the function pointers needed to implement @@ -665,10 +665,10 @@ typedef psa_status_t (*psa_drv_aead_opaque_decrypt_t)(psa_key_slot_t key_slot, */ typedef struct { /** Function that performs the AEAD encrypt operation */ - psa_drv_aead_opaque_encrypt_t *p_encrypt; + psa_drv_se_aead_encrypt_t *p_encrypt; /** Function that performs the AEAD decrypt operation */ - psa_drv_aead_opaque_decrypt_t *p_decrypt; -} psa_drv_aead_opaque_t; + psa_drv_se_aead_decrypt_t *p_decrypt; +} psa_drv_se_aead_t; /**@}*/ /** \defgroup driver_key_management Key Management @@ -696,12 +696,12 @@ typedef struct { * \retval #PSA_SUCCESS * Success. */ -typedef psa_status_t (*psa_drv_opaque_import_key_t)(psa_key_slot_t key_slot, - psa_key_type_t type, - psa_algorithm_t algorithm, - psa_key_usage_t usage, - const uint8_t *p_data, - size_t data_length); +typedef psa_status_t (*psa_drv_se_import_key_t)(psa_key_slot_t key_slot, + psa_key_type_t type, + psa_algorithm_t algorithm, + psa_key_usage_t usage, + const uint8_t *p_data, + size_t data_length); /** * \brief Destroy a key and restore the slot to its default state @@ -719,7 +719,7 @@ typedef psa_status_t (*psa_drv_opaque_import_key_t)(psa_key_slot_t key_slot, * \retval #PSA_SUCCESS * The slot's content, if any, has been erased. */ -typedef psa_status_t (*psa_drv_destroy_key_t)(psa_key_slot_t key); +typedef psa_status_t (*psa_drv_se_destroy_key_t)(psa_key_slot_t key); /** * \brief Export a key in binary format @@ -761,10 +761,10 @@ typedef psa_status_t (*psa_drv_destroy_key_t)(psa_key_slot_t key); * \retval #PSA_ERROR_HARDWARE_FAILURE * \retval #PSA_ERROR_TAMPERING_DETECTED */ -typedef psa_status_t (*psa_drv_export_key_t)(psa_key_slot_t key, - uint8_t *p_data, - size_t data_size, - size_t *p_data_length); +typedef psa_status_t (*psa_drv_se_export_key_t)(psa_key_slot_t key, + uint8_t *p_data, + size_t data_size, + size_t *p_data_length); /** * \brief Export a public key or the public part of a key pair in binary format @@ -787,7 +787,7 @@ typedef psa_status_t (*psa_drv_export_key_t)(psa_key_slot_t key, * * \retval #PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_export_public_key_t)(psa_key_slot_t key, +typedef psa_status_t (*psa_drv_se_export_public_key_t)(psa_key_slot_t key, uint8_t *p_data, size_t data_size, size_t *p_data_length); @@ -803,14 +803,14 @@ typedef psa_status_t (*psa_drv_export_public_key_t)(psa_key_slot_t key, */ typedef struct { /** Function that performs the key import operation */ - psa_drv_opaque_import_key_t *p_import; + psa_drv_se_import_key_t *p_import; /** Function that performs the key destroy operation */ - psa_drv_destroy_key_t *p_destroy; + psa_drv_se_destroy_key_t *p_destroy; /** Function that performs the key export operation */ - psa_drv_export_key_t *p_export; + psa_drv_se_export_key_t *p_export; /** Function that perforsm the public key export operation */ - psa_drv_export_public_key_t *p_export_public; -} psa_drv_key_management_t; + psa_drv_se_export_public_key_t *p_export_public; +} psa_drv_se_key_management_t; /**@}*/ @@ -881,9 +881,9 @@ typedef struct psa_drv_key_derivation_context_s psa_drv_key_derivation_context_t * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_key_derivation_setup_t)(psa_drv_key_derivation_context_t *p_context, - psa_algorithm_t kdf_alg, - psa_key_slot_t source_key); +typedef psa_status_t (*psa_drv_se_key_derivation_setup_t)(psa_drv_key_derivation_context_t *p_context, + psa_algorithm_t kdf_alg, + psa_key_slot_t source_key); /** \brief Provide collateral (parameters) needed for a key derivation or key * agreement operation @@ -900,10 +900,10 @@ typedef psa_status_t (*psa_drv_key_derivation_setup_t)(psa_drv_key_derivation_co * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_key_derivation_collateral_t)(psa_drv_key_derivation_context_t *p_context, - uint32_t collateral_id, - const uint8_t *p_collateral, - size_t collateral_size); +typedef psa_status_t (*psa_drv_se_key_derivation_collateral_t)(psa_drv_key_derivation_context_t *p_context, + uint32_t collateral_id, + const uint8_t *p_collateral, + size_t collateral_size); /** \brief Perform the final key derivation step and place the generated key * material in a slot @@ -914,7 +914,7 @@ typedef psa_status_t (*psa_drv_key_derivation_collateral_t)(psa_drv_key_derivati * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_key_derivation_derive_t)(psa_drv_key_derivation_context_t *p_context, +typedef psa_status_t (*psa_drv_se_key_derivation_derive_t)(psa_drv_key_derivation_context_t *p_context, psa_key_slot_t dest_key); /** \brief Perform the final step of a key agreement and place the generated @@ -928,7 +928,7 @@ typedef psa_status_t (*psa_drv_key_derivation_derive_t)(psa_drv_key_derivation_c * * \retval PSA_SUCCESS */ -typedef psa_status_t (*psa_drv_key_derivation_export_t)(uint8_t *p_output, +typedef psa_status_t (*psa_drv_se_key_derivation_export_t)(uint8_t *p_output, size_t output_size, size_t *p_output_length); @@ -943,15 +943,15 @@ typedef psa_status_t (*psa_drv_key_derivation_export_t)(uint8_t *p_output, */ typedef struct { /** Function that performs the key derivation setup */ - psa_drv_key_derivation_setup_t *p_setup; + psa_drv_se_key_derivation_setup_t *p_setup; /** Function that sets the key derivation collateral */ - psa_drv_key_derivation_collateral_t *p_collateral; + psa_drv_se_key_derivation_collateral_t *p_collateral; /** Function that performs the final key derivation step */ - psa_drv_key_derivation_derive_t *p_derive; + psa_drv_se_key_derivation_derive_t *p_derive; /** Function that perforsm the final key derivation or agreement and * exports the key */ - psa_drv_key_derivation_export_t *p_export; -} psa_drv_key_derivation_t; + psa_drv_se_key_derivation_export_t *p_export; +} psa_drv_se_key_derivation_t; /**@}*/