Separate sign/verify message and hash operations
Previous versions of mbedtls didn't distinguish between
asymmetric sign and verify operations on a hash or message.
They are now treated as separate operations from a usage
control perspective. This change makes the corresponding
hash/message sepration in client and service provider
components.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I134286d66c3943090055171adfdf16270f395aa3
diff --git a/components/service/crypto/client/cpp/crypto_client.h b/components/service/crypto/client/cpp/crypto_client.h
index 2a5e5b9..ccb0714 100644
--- a/components/service/crypto/client/cpp/crypto_client.h
+++ b/components/service/crypto/client/cpp/crypto_client.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -57,7 +57,7 @@
psa_key_id_t id,
uint8_t *data, size_t data_size, size_t *data_length) = 0;
- /* Sign/verify methods */
+ /* Sign/verify hash methods */
virtual psa_status_t sign_hash(
psa_key_id_t id,
psa_algorithm_t alg,
@@ -70,6 +70,19 @@
const uint8_t *hash, size_t hash_length,
const uint8_t *signature, size_t signature_length) = 0;
+ /* Sign/verify message methods */
+ virtual psa_status_t sign_message(
+ psa_key_id_t id,
+ psa_algorithm_t alg,
+ const uint8_t *message, size_t message_length,
+ uint8_t *signature, size_t signature_size, size_t *signature_length) = 0;
+
+ virtual psa_status_t verify_message(
+ psa_key_id_t id,
+ psa_algorithm_t alg,
+ const uint8_t *message, size_t message_length,
+ const uint8_t *signature, size_t signature_length) = 0;
+
/* Asymmetric encrypt/decrypt */
virtual psa_status_t asymmetric_encrypt(
psa_key_id_t id,