Crypto: Align to PSA Crypto headers 0.1.0a
This patch updates the PSA Crypto API headers to version
0.1.0a. The Crypto service implementation is updated when
needed to make sure the service is buildable and functional.
Change-Id: I63709db0d87f449012d0c8355658f1af1583b3ab
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/interface/src/tfm_crypto_api.c b/interface/src/tfm_crypto_api.c
index dbeb6a8..a51ac1f 100644
--- a/interface/src/tfm_crypto_api.c
+++ b/interface/src/tfm_crypto_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -87,13 +87,13 @@
return PSA_ERROR_NOT_SUPPORTED;
}
-psa_status_t psa_encrypt_set_iv(psa_cipher_operation_t *operation,
- const unsigned char *iv,
- size_t iv_length)
+psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation,
+ const unsigned char *iv,
+ size_t iv_length)
{
enum tfm_crypto_err_t err;
- err = tfm_ns_lock_dispatch((veneer_fn)tfm_crypto_veneer_encrypt_set_iv,
+ err = tfm_ns_lock_dispatch((veneer_fn)tfm_crypto_veneer_cipher_set_iv,
(uint32_t)operation,
(uint32_t)iv,
(uint32_t)iv_length,
@@ -102,32 +102,34 @@
return TFM_CRYPTO_PSA_RETURN(err);
}
-psa_status_t psa_encrypt_setup(psa_cipher_operation_t *operation,
- psa_key_slot_t key,
- psa_algorithm_t alg)
+psa_status_t psa_cipher_encrypt_setup(psa_cipher_operation_t *operation,
+ psa_key_slot_t key,
+ psa_algorithm_t alg)
{
enum tfm_crypto_err_t err;
- err = tfm_ns_lock_dispatch((veneer_fn)tfm_crypto_veneer_encrypt_setup,
- (uint32_t)operation,
- (uint32_t)key,
- (uint32_t)alg,
- 0);
+ err = tfm_ns_lock_dispatch(
+ (veneer_fn)tfm_crypto_veneer_cipher_encrypt_setup,
+ (uint32_t)operation,
+ (uint32_t)key,
+ (uint32_t)alg,
+ 0);
return TFM_CRYPTO_PSA_RETURN(err);
}
-psa_status_t psa_decrypt_setup(psa_cipher_operation_t *operation,
- psa_key_slot_t key,
- psa_algorithm_t alg)
+psa_status_t psa_cipher_decrypt_setup(psa_cipher_operation_t *operation,
+ psa_key_slot_t key,
+ psa_algorithm_t alg)
{
enum tfm_crypto_err_t err;
- err = tfm_ns_lock_dispatch((veneer_fn)tfm_crypto_veneer_decrypt_setup,
- (uint32_t)operation,
- (uint32_t)key,
- (uint32_t)alg,
- 0);
+ err = tfm_ns_lock_dispatch(
+ (veneer_fn)tfm_crypto_veneer_cipher_decrypt_setup,
+ (uint32_t)operation,
+ (uint32_t)key,
+ (uint32_t)alg,
+ 0);
return TFM_CRYPTO_PSA_RETURN(err);
}
@@ -189,12 +191,12 @@
return TFM_CRYPTO_PSA_RETURN(err);
}
-psa_status_t psa_hash_start(psa_hash_operation_t *operation,
+psa_status_t psa_hash_setup(psa_hash_operation_t *operation,
psa_algorithm_t alg)
{
enum tfm_crypto_err_t err;
- err = tfm_ns_lock_dispatch((veneer_fn)tfm_crypto_veneer_hash_start,
+ err = tfm_ns_lock_dispatch((veneer_fn)tfm_crypto_veneer_hash_setup,
(uint32_t)operation,
(uint32_t)alg,
0,