Define the psa wrapper functions as static inline
This is a commit from Thomas Daubney. Signed-off-by: Thomas Daubney <thomas.daubney@arm.com> Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
parent
fc9fc334de
commit
7046468a02
5 changed files with 127 additions and 127 deletions
1
3rdparty/p256-m/p256-m_driver_entrypoints.c
vendored
1
3rdparty/p256-m/p256-m_driver_entrypoints.c
vendored
|
@ -22,7 +22,6 @@
|
|||
#include "p256-m_driver_entrypoints.h"
|
||||
#include "p256-m/p256-m.h"
|
||||
#include "psa/crypto.h"
|
||||
#include "psa_crypto_driver_wrappers.h"
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "psa_crypto_cipher.h"
|
||||
#include "psa_crypto_core.h"
|
||||
#include "psa_crypto_invasive.h"
|
||||
#include "psa_crypto_driver_wrappers.h"
|
||||
#include "psa_crypto_driver_wrappers.c"
|
||||
#include "psa_crypto_ecp.h"
|
||||
#include "psa_crypto_ffdh.h"
|
||||
#include "psa_crypto_hash.h"
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
/*
|
||||
* Initialization and termination functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_init(void);
|
||||
void psa_driver_wrapper_free(void);
|
||||
static inline psa_status_t psa_driver_wrapper_init(void);
|
||||
static inline void psa_driver_wrapper_free(void);
|
||||
|
||||
/*
|
||||
* Signature functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_sign_message(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_message(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -48,7 +48,7 @@ psa_status_t psa_driver_wrapper_sign_message(
|
|||
size_t signature_size,
|
||||
size_t *signature_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_message(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_message(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -58,13 +58,13 @@ psa_status_t psa_driver_wrapper_verify_message(
|
|||
const uint8_t *signature,
|
||||
size_t signature_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg, const uint8_t *hash, size_t hash_length,
|
||||
uint8_t *signature, size_t signature_size, size_t *signature_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg, const uint8_t *hash, size_t hash_length,
|
||||
|
@ -74,79 +74,79 @@ psa_status_t psa_driver_wrapper_verify_hash(
|
|||
* Interruptible Signature functions
|
||||
*/
|
||||
|
||||
uint32_t psa_driver_wrapper_sign_hash_get_num_ops(
|
||||
static inline uint32_t psa_driver_wrapper_sign_hash_get_num_ops(
|
||||
psa_sign_hash_interruptible_operation_t *operation);
|
||||
|
||||
uint32_t psa_driver_wrapper_verify_hash_get_num_ops(
|
||||
static inline uint32_t psa_driver_wrapper_verify_hash_get_num_ops(
|
||||
psa_verify_hash_interruptible_operation_t *operation);
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash_start(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash_start(
|
||||
psa_sign_hash_interruptible_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
|
||||
size_t key_buffer_size, psa_algorithm_t alg,
|
||||
const uint8_t *hash, size_t hash_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash_complete(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash_complete(
|
||||
psa_sign_hash_interruptible_operation_t *operation,
|
||||
uint8_t *signature, size_t signature_size,
|
||||
size_t *signature_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash_abort(
|
||||
psa_sign_hash_interruptible_operation_t *operation);
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash_start(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash_start(
|
||||
psa_verify_hash_interruptible_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
|
||||
size_t key_buffer_size, psa_algorithm_t alg,
|
||||
const uint8_t *hash, size_t hash_length,
|
||||
const uint8_t *signature, size_t signature_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash_complete(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash_complete(
|
||||
psa_verify_hash_interruptible_operation_t *operation);
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash_abort(
|
||||
psa_verify_hash_interruptible_operation_t *operation);
|
||||
|
||||
/*
|
||||
* Key handling functions
|
||||
*/
|
||||
|
||||
psa_status_t psa_driver_wrapper_import_key(
|
||||
static inline psa_status_t psa_driver_wrapper_import_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *data, size_t data_length,
|
||||
uint8_t *key_buffer, size_t key_buffer_size,
|
||||
size_t *key_buffer_length, size_t *bits);
|
||||
|
||||
psa_status_t psa_driver_wrapper_export_key(
|
||||
static inline psa_status_t psa_driver_wrapper_export_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
uint8_t *data, size_t data_size, size_t *data_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_export_public_key(
|
||||
static inline psa_status_t psa_driver_wrapper_export_public_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
uint8_t *data, size_t data_size, size_t *data_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_get_key_buffer_size(
|
||||
static inline psa_status_t psa_driver_wrapper_get_key_buffer_size(
|
||||
const psa_key_attributes_t *attributes,
|
||||
size_t *key_buffer_size);
|
||||
|
||||
psa_status_t psa_driver_wrapper_get_key_buffer_size_from_key_data(
|
||||
static inline psa_status_t psa_driver_wrapper_get_key_buffer_size_from_key_data(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *data,
|
||||
size_t data_length,
|
||||
size_t *key_buffer_size);
|
||||
|
||||
psa_status_t psa_driver_wrapper_generate_key(
|
||||
static inline psa_status_t psa_driver_wrapper_generate_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_get_builtin_key(
|
||||
static inline psa_status_t psa_driver_wrapper_get_builtin_key(
|
||||
psa_drv_slot_number_t slot_number,
|
||||
psa_key_attributes_t *attributes,
|
||||
uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_copy_key(
|
||||
static inline psa_status_t psa_driver_wrapper_copy_key(
|
||||
psa_key_attributes_t *attributes,
|
||||
const uint8_t *source_key, size_t source_key_length,
|
||||
uint8_t *target_key_buffer, size_t target_key_buffer_size,
|
||||
|
@ -154,7 +154,7 @@ psa_status_t psa_driver_wrapper_copy_key(
|
|||
/*
|
||||
* Cipher functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_cipher_encrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_encrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -167,7 +167,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
|
|||
size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_decrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_decrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -178,24 +178,24 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
|
|||
size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
|
||||
psa_cipher_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg);
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
|
||||
psa_cipher_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg);
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_set_iv(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_set_iv(
|
||||
psa_cipher_operation_t *operation,
|
||||
const uint8_t *iv,
|
||||
size_t iv_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_update(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_update(
|
||||
psa_cipher_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length,
|
||||
|
@ -203,19 +203,19 @@ psa_status_t psa_driver_wrapper_cipher_update(
|
|||
size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_finish(
|
||||
psa_cipher_operation_t *operation,
|
||||
uint8_t *output,
|
||||
size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_abort(
|
||||
psa_cipher_operation_t *operation);
|
||||
|
||||
/*
|
||||
* Hashing functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_hash_compute(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_compute(
|
||||
psa_algorithm_t alg,
|
||||
const uint8_t *input,
|
||||
size_t input_length,
|
||||
|
@ -223,33 +223,33 @@ psa_status_t psa_driver_wrapper_hash_compute(
|
|||
size_t hash_size,
|
||||
size_t *hash_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_setup(
|
||||
psa_hash_operation_t *operation,
|
||||
psa_algorithm_t alg);
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_clone(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_clone(
|
||||
const psa_hash_operation_t *source_operation,
|
||||
psa_hash_operation_t *target_operation);
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_update(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_update(
|
||||
psa_hash_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_finish(
|
||||
psa_hash_operation_t *operation,
|
||||
uint8_t *hash,
|
||||
size_t hash_size,
|
||||
size_t *hash_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_abort(
|
||||
psa_hash_operation_t *operation);
|
||||
|
||||
/*
|
||||
* AEAD functions
|
||||
*/
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_encrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_encrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg,
|
||||
|
@ -258,7 +258,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
|
|||
const uint8_t *plaintext, size_t plaintext_length,
|
||||
uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_decrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_decrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg,
|
||||
|
@ -267,34 +267,34 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
|
|||
const uint8_t *ciphertext, size_t ciphertext_length,
|
||||
uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_encrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_encrypt_setup(
|
||||
psa_aead_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_decrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_decrypt_setup(
|
||||
psa_aead_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_set_nonce(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_set_nonce(
|
||||
psa_aead_operation_t *operation,
|
||||
const uint8_t *nonce,
|
||||
size_t nonce_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_set_lengths(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_set_lengths(
|
||||
psa_aead_operation_t *operation,
|
||||
size_t ad_length,
|
||||
size_t plaintext_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_update_ad(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_update_ad(
|
||||
psa_aead_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_update(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_update(
|
||||
psa_aead_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length,
|
||||
|
@ -302,7 +302,7 @@ psa_status_t psa_driver_wrapper_aead_update(
|
|||
size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_finish(
|
||||
psa_aead_operation_t *operation,
|
||||
uint8_t *ciphertext,
|
||||
size_t ciphertext_size,
|
||||
|
@ -311,7 +311,7 @@ psa_status_t psa_driver_wrapper_aead_finish(
|
|||
size_t tag_size,
|
||||
size_t *tag_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_verify(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_verify(
|
||||
psa_aead_operation_t *operation,
|
||||
uint8_t *plaintext,
|
||||
size_t plaintext_size,
|
||||
|
@ -319,13 +319,13 @@ psa_status_t psa_driver_wrapper_aead_verify(
|
|||
const uint8_t *tag,
|
||||
size_t tag_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_abort(
|
||||
psa_aead_operation_t *operation);
|
||||
|
||||
/*
|
||||
* MAC functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_mac_compute(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_compute(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -336,43 +336,43 @@ psa_status_t psa_driver_wrapper_mac_compute(
|
|||
size_t mac_size,
|
||||
size_t *mac_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_sign_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_sign_setup(
|
||||
psa_mac_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
psa_algorithm_t alg);
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_verify_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_verify_setup(
|
||||
psa_mac_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
psa_algorithm_t alg);
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_update(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_update(
|
||||
psa_mac_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_sign_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_sign_finish(
|
||||
psa_mac_operation_t *operation,
|
||||
uint8_t *mac,
|
||||
size_t mac_size,
|
||||
size_t *mac_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_verify_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_verify_finish(
|
||||
psa_mac_operation_t *operation,
|
||||
const uint8_t *mac,
|
||||
size_t mac_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_abort(
|
||||
psa_mac_operation_t *operation);
|
||||
|
||||
/*
|
||||
* Asymmetric cryptography
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_asymmetric_encrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_asymmetric_encrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -385,7 +385,7 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt(
|
|||
size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_asymmetric_decrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_asymmetric_decrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -401,7 +401,7 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
|
|||
/*
|
||||
* Raw Key Agreement
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_key_agreement(
|
||||
static inline psa_status_t psa_driver_wrapper_key_agreement(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -415,29 +415,29 @@ psa_status_t psa_driver_wrapper_key_agreement(
|
|||
/*
|
||||
* PAKE functions.
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_pake_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_setup(
|
||||
psa_pake_operation_t *operation,
|
||||
const psa_crypto_driver_pake_inputs_t *inputs);
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_output(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_output(
|
||||
psa_pake_operation_t *operation,
|
||||
psa_crypto_driver_pake_step_t step,
|
||||
uint8_t *output,
|
||||
size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_input(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_input(
|
||||
psa_pake_operation_t *operation,
|
||||
psa_crypto_driver_pake_step_t step,
|
||||
const uint8_t *input,
|
||||
size_t input_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_get_implicit_key(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_get_implicit_key(
|
||||
psa_pake_operation_t *operation,
|
||||
uint8_t *output, size_t output_size,
|
||||
size_t *output_length);
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_abort(
|
||||
psa_pake_operation_t *operation);
|
||||
|
||||
#endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "psa/crypto.h"
|
||||
|
||||
#include "psa_crypto_core.h"
|
||||
#include "psa_crypto_driver_wrappers.h"
|
||||
#include "psa_crypto_driver_wrappers.c"
|
||||
#include "psa_crypto_slot_management.h"
|
||||
#include "psa_crypto_storage.h"
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
#include "psa_crypto_se.h"
|
||||
#endif
|
||||
|
||||
psa_status_t psa_driver_wrapper_init( void )
|
||||
static inline psa_status_t psa_driver_wrapper_init( void )
|
||||
{
|
||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||
|
||||
|
@ -106,7 +106,7 @@ psa_status_t psa_driver_wrapper_init( void )
|
|||
return( PSA_SUCCESS );
|
||||
}
|
||||
|
||||
void psa_driver_wrapper_free( void )
|
||||
static inline void psa_driver_wrapper_free( void )
|
||||
{
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
|
||||
/* Unregister all secure element drivers, so that we restart from
|
||||
|
@ -121,7 +121,7 @@ void psa_driver_wrapper_free( void )
|
|||
}
|
||||
|
||||
/* Start delegation functions */
|
||||
psa_status_t psa_driver_wrapper_sign_message(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_message(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -196,7 +196,7 @@ psa_status_t psa_driver_wrapper_sign_message(
|
|||
signature_length ) );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_message(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_message(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -267,7 +267,7 @@ psa_status_t psa_driver_wrapper_verify_message(
|
|||
signature_length ) );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg, const uint8_t *hash, size_t hash_length,
|
||||
|
@ -371,7 +371,7 @@ psa_status_t psa_driver_wrapper_sign_hash(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg, const uint8_t *hash, size_t hash_length,
|
||||
|
@ -472,7 +472,7 @@ psa_status_t psa_driver_wrapper_verify_hash(
|
|||
}
|
||||
}
|
||||
|
||||
uint32_t psa_driver_wrapper_sign_hash_get_num_ops(
|
||||
static inline uint32_t psa_driver_wrapper_sign_hash_get_num_ops(
|
||||
psa_sign_hash_interruptible_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -495,7 +495,7 @@ uint32_t psa_driver_wrapper_sign_hash_get_num_ops(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
uint32_t psa_driver_wrapper_verify_hash_get_num_ops(
|
||||
static inline uint32_t psa_driver_wrapper_verify_hash_get_num_ops(
|
||||
psa_verify_hash_interruptible_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -519,7 +519,7 @@ uint32_t psa_driver_wrapper_verify_hash_get_num_ops(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash_start(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash_start(
|
||||
psa_sign_hash_interruptible_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
|
||||
size_t key_buffer_size, psa_algorithm_t alg,
|
||||
|
@ -572,7 +572,7 @@ psa_status_t psa_driver_wrapper_sign_hash_start(
|
|||
return( status );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash_complete(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash_complete(
|
||||
psa_sign_hash_interruptible_operation_t *operation,
|
||||
uint8_t *signature, size_t signature_size,
|
||||
size_t *signature_length )
|
||||
|
@ -599,7 +599,7 @@ psa_status_t psa_driver_wrapper_sign_hash_complete(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_sign_hash_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_sign_hash_abort(
|
||||
psa_sign_hash_interruptible_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -618,7 +618,7 @@ psa_status_t psa_driver_wrapper_sign_hash_abort(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash_start(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash_start(
|
||||
psa_verify_hash_interruptible_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
|
||||
size_t key_buffer_size, psa_algorithm_t alg,
|
||||
|
@ -676,7 +676,7 @@ psa_status_t psa_driver_wrapper_verify_hash_start(
|
|||
return( status );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash_complete(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash_complete(
|
||||
psa_verify_hash_interruptible_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -697,7 +697,7 @@ psa_status_t psa_driver_wrapper_verify_hash_complete(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_verify_hash_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_verify_hash_abort(
|
||||
psa_verify_hash_interruptible_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -729,7 +729,7 @@ psa_status_t psa_driver_wrapper_verify_hash_abort(
|
|||
* \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription
|
||||
* \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_get_key_buffer_size_from_key_data(
|
||||
static inline psa_status_t psa_driver_wrapper_get_key_buffer_size_from_key_data(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *data,
|
||||
size_t data_length,
|
||||
|
@ -773,7 +773,7 @@ psa_status_t psa_driver_wrapper_get_key_buffer_size_from_key_data(
|
|||
* \retval #PSA_ERROR_INVALID_ARGUMENT
|
||||
* The key is declared with a lifetime not known to us.
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_get_key_buffer_size(
|
||||
static inline psa_status_t psa_driver_wrapper_get_key_buffer_size(
|
||||
const psa_key_attributes_t *attributes,
|
||||
size_t *key_buffer_size )
|
||||
{
|
||||
|
@ -809,7 +809,7 @@ psa_status_t psa_driver_wrapper_get_key_buffer_size(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_generate_key(
|
||||
static inline psa_status_t psa_driver_wrapper_generate_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length )
|
||||
{
|
||||
|
@ -895,7 +895,7 @@ psa_status_t psa_driver_wrapper_generate_key(
|
|||
return( status );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_import_key(
|
||||
static inline psa_status_t psa_driver_wrapper_import_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *data,
|
||||
size_t data_length,
|
||||
|
@ -976,7 +976,7 @@ bits
|
|||
{% endwith %}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_export_key(
|
||||
static inline psa_status_t psa_driver_wrapper_export_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
uint8_t *data, size_t data_size, size_t *data_length )
|
||||
|
@ -1038,7 +1038,7 @@ data_length
|
|||
{% endwith %}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_export_public_key(
|
||||
static inline psa_status_t psa_driver_wrapper_export_public_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
uint8_t *data, size_t data_size, size_t *data_length )
|
||||
|
@ -1108,7 +1108,7 @@ data_length
|
|||
{% endwith %}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_get_builtin_key(
|
||||
static inline psa_status_t psa_driver_wrapper_get_builtin_key(
|
||||
psa_drv_slot_number_t slot_number,
|
||||
psa_key_attributes_t *attributes,
|
||||
uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length )
|
||||
|
@ -1139,7 +1139,7 @@ key_buffer_length
|
|||
{% endwith %}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_copy_key(
|
||||
static inline psa_status_t psa_driver_wrapper_copy_key(
|
||||
psa_key_attributes_t *attributes,
|
||||
const uint8_t *source_key, size_t source_key_length,
|
||||
uint8_t *target_key_buffer, size_t target_key_buffer_size,
|
||||
|
@ -1191,7 +1191,7 @@ target_key_buffer_length
|
|||
/*
|
||||
* Cipher functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_cipher_encrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_encrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -1283,7 +1283,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_decrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_decrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -1365,7 +1365,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
|
||||
psa_cipher_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
|
@ -1438,7 +1438,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
|
||||
psa_cipher_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
|
@ -1511,7 +1511,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_set_iv(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_set_iv(
|
||||
psa_cipher_operation_t *operation,
|
||||
const uint8_t *iv,
|
||||
size_t iv_length )
|
||||
|
@ -1546,7 +1546,7 @@ psa_status_t psa_driver_wrapper_cipher_set_iv(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_update(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_update(
|
||||
psa_cipher_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length,
|
||||
|
@ -1592,7 +1592,7 @@ psa_status_t psa_driver_wrapper_cipher_update(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_finish(
|
||||
psa_cipher_operation_t *operation,
|
||||
uint8_t *output,
|
||||
size_t output_size,
|
||||
|
@ -1630,7 +1630,7 @@ psa_status_t psa_driver_wrapper_cipher_finish(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_cipher_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_cipher_abort(
|
||||
psa_cipher_operation_t *operation )
|
||||
{
|
||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||
|
@ -1670,7 +1670,7 @@ psa_status_t psa_driver_wrapper_cipher_abort(
|
|||
/*
|
||||
* Hashing functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_hash_compute(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_compute(
|
||||
psa_algorithm_t alg,
|
||||
const uint8_t *input,
|
||||
size_t input_length,
|
||||
|
@ -1706,7 +1706,7 @@ psa_status_t psa_driver_wrapper_hash_compute(
|
|||
return( PSA_ERROR_NOT_SUPPORTED );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_setup(
|
||||
psa_hash_operation_t *operation,
|
||||
psa_algorithm_t alg )
|
||||
{
|
||||
|
@ -1739,7 +1739,7 @@ psa_status_t psa_driver_wrapper_hash_setup(
|
|||
return( PSA_ERROR_NOT_SUPPORTED );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_clone(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_clone(
|
||||
const psa_hash_operation_t *source_operation,
|
||||
psa_hash_operation_t *target_operation )
|
||||
{
|
||||
|
@ -1764,7 +1764,7 @@ psa_status_t psa_driver_wrapper_hash_clone(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_update(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_update(
|
||||
psa_hash_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length )
|
||||
|
@ -1789,7 +1789,7 @@ psa_status_t psa_driver_wrapper_hash_update(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_finish(
|
||||
psa_hash_operation_t *operation,
|
||||
uint8_t *hash,
|
||||
size_t hash_size,
|
||||
|
@ -1816,7 +1816,7 @@ psa_status_t psa_driver_wrapper_hash_finish(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_hash_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_hash_abort(
|
||||
psa_hash_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -1835,7 +1835,7 @@ psa_status_t psa_driver_wrapper_hash_abort(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_encrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_encrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg,
|
||||
|
@ -1887,7 +1887,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_decrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_decrypt(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
psa_algorithm_t alg,
|
||||
|
@ -1939,7 +1939,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_encrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_encrypt_setup(
|
||||
psa_aead_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
|
@ -1987,7 +1987,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_decrypt_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_decrypt_setup(
|
||||
psa_aead_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer, size_t key_buffer_size,
|
||||
|
@ -2037,7 +2037,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_set_nonce(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_set_nonce(
|
||||
psa_aead_operation_t *operation,
|
||||
const uint8_t *nonce,
|
||||
size_t nonce_length )
|
||||
|
@ -2071,7 +2071,7 @@ psa_status_t psa_driver_wrapper_aead_set_nonce(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_set_lengths(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_set_lengths(
|
||||
psa_aead_operation_t *operation,
|
||||
size_t ad_length,
|
||||
size_t plaintext_length )
|
||||
|
@ -2105,7 +2105,7 @@ psa_status_t psa_driver_wrapper_aead_set_lengths(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_update_ad(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_update_ad(
|
||||
psa_aead_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length )
|
||||
|
@ -2139,7 +2139,7 @@ psa_status_t psa_driver_wrapper_aead_update_ad(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_update(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_update(
|
||||
psa_aead_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length,
|
||||
|
@ -2181,7 +2181,7 @@ psa_status_t psa_driver_wrapper_aead_update(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_finish(
|
||||
psa_aead_operation_t *operation,
|
||||
uint8_t *ciphertext,
|
||||
size_t ciphertext_size,
|
||||
|
@ -2226,7 +2226,7 @@ psa_status_t psa_driver_wrapper_aead_finish(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_verify(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_verify(
|
||||
psa_aead_operation_t *operation,
|
||||
uint8_t *plaintext,
|
||||
size_t plaintext_size,
|
||||
|
@ -2289,7 +2289,7 @@ psa_status_t psa_driver_wrapper_aead_verify(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_aead_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_aead_abort(
|
||||
psa_aead_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -2318,7 +2318,7 @@ psa_status_t psa_driver_wrapper_aead_abort(
|
|||
/*
|
||||
* MAC functions
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_mac_compute(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_compute(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -2386,7 +2386,7 @@ psa_status_t psa_driver_wrapper_mac_compute(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_sign_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_sign_setup(
|
||||
psa_mac_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
|
@ -2458,7 +2458,7 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_verify_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_verify_setup(
|
||||
psa_mac_operation_t *operation,
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
|
@ -2530,7 +2530,7 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_update(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_update(
|
||||
psa_mac_operation_t *operation,
|
||||
const uint8_t *input,
|
||||
size_t input_length )
|
||||
|
@ -2563,7 +2563,7 @@ psa_status_t psa_driver_wrapper_mac_update(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_sign_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_sign_finish(
|
||||
psa_mac_operation_t *operation,
|
||||
uint8_t *mac,
|
||||
size_t mac_size,
|
||||
|
@ -2598,7 +2598,7 @@ psa_status_t psa_driver_wrapper_mac_sign_finish(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_verify_finish(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_verify_finish(
|
||||
psa_mac_operation_t *operation,
|
||||
const uint8_t *mac,
|
||||
size_t mac_length )
|
||||
|
@ -2631,7 +2631,7 @@ psa_status_t psa_driver_wrapper_mac_verify_finish(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_mac_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_mac_abort(
|
||||
psa_mac_operation_t *operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
@ -2659,7 +2659,7 @@ psa_status_t psa_driver_wrapper_mac_abort(
|
|||
/*
|
||||
* Asymmetric cryptography
|
||||
*/
|
||||
psa_status_t psa_driver_wrapper_asymmetric_encrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_asymmetric_encrypt(
|
||||
const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
|
||||
size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input,
|
||||
size_t input_length, const uint8_t *salt, size_t salt_length,
|
||||
|
@ -2717,7 +2717,7 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_asymmetric_decrypt(
|
||||
static inline psa_status_t psa_driver_wrapper_asymmetric_decrypt(
|
||||
const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
|
||||
size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input,
|
||||
size_t input_length, const uint8_t *salt, size_t salt_length,
|
||||
|
@ -2775,7 +2775,7 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_key_agreement(
|
||||
static inline psa_status_t psa_driver_wrapper_key_agreement(
|
||||
const psa_key_attributes_t *attributes,
|
||||
const uint8_t *key_buffer,
|
||||
size_t key_buffer_size,
|
||||
|
@ -2862,7 +2862,7 @@ psa_status_t psa_driver_wrapper_key_agreement(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_setup(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_setup(
|
||||
psa_pake_operation_t *operation,
|
||||
const psa_crypto_driver_pake_inputs_t *inputs )
|
||||
{
|
||||
|
@ -2905,7 +2905,8 @@ psa_status_t psa_driver_wrapper_pake_setup(
|
|||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
}
|
||||
}
|
||||
psa_status_t psa_driver_wrapper_pake_output(
|
||||
|
||||
static inline psa_status_t psa_driver_wrapper_pake_output(
|
||||
psa_pake_operation_t *operation,
|
||||
psa_crypto_driver_pake_step_t step,
|
||||
uint8_t *output,
|
||||
|
@ -2937,7 +2938,7 @@ psa_status_t psa_driver_wrapper_pake_output(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_input(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_input(
|
||||
psa_pake_operation_t *operation,
|
||||
psa_crypto_driver_pake_step_t step,
|
||||
const uint8_t *input,
|
||||
|
@ -2969,7 +2970,7 @@ psa_status_t psa_driver_wrapper_pake_input(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_get_implicit_key(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_get_implicit_key(
|
||||
psa_pake_operation_t *operation,
|
||||
uint8_t *output, size_t output_size,
|
||||
size_t *output_length )
|
||||
|
@ -2998,7 +2999,7 @@ psa_status_t psa_driver_wrapper_pake_get_implicit_key(
|
|||
}
|
||||
}
|
||||
|
||||
psa_status_t psa_driver_wrapper_pake_abort(
|
||||
static inline psa_status_t psa_driver_wrapper_pake_abort(
|
||||
psa_pake_operation_t * operation )
|
||||
{
|
||||
switch( operation->id )
|
||||
|
|
Loading…
Reference in a new issue