Add key derivation service level tests
Adds end-to-end service tests for key derivation operations
provided by a crypto provider.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I1fa0f0f269d9f32fc05ee116edf0ccea618dd17f
diff --git a/components/service/crypto/client/cpp/crypto_client.h b/components/service/crypto/client/cpp/crypto_client.h
index eb30655..2a5e5b9 100644
--- a/components/service/crypto/client/cpp/crypto_client.h
+++ b/components/service/crypto/client/cpp/crypto_client.h
@@ -176,6 +176,51 @@
virtual psa_status_t mac_abort(
uint32_t op_handle) = 0;
+ /* Key derivation methods */
+ virtual psa_status_t key_derivation_setup(
+ uint32_t *op_handle,
+ psa_algorithm_t alg) = 0;
+
+ virtual psa_status_t key_derivation_get_capacity(
+ const uint32_t op_handle,
+ size_t *capacity) = 0;
+
+ virtual psa_status_t key_derivation_set_capacity(
+ uint32_t op_handle,
+ size_t capacity) = 0;
+
+ virtual psa_status_t key_derivation_input_bytes(
+ uint32_t op_handle,
+ psa_key_derivation_step_t step,
+ const uint8_t *data, size_t data_length) = 0;
+
+ virtual psa_status_t key_derivation_input_key(
+ uint32_t op_handle,
+ psa_key_derivation_step_t step,
+ psa_key_id_t key) = 0;
+
+ virtual psa_status_t key_derivation_output_bytes(
+ uint32_t op_handle,
+ uint8_t *output, size_t output_length) = 0;
+
+ virtual psa_status_t key_derivation_output_key(
+ const psa_key_attributes_t *attributes,
+ uint32_t op_handle,
+ psa_key_id_t *key) = 0;
+
+ virtual psa_status_t key_derivation_abort(
+ uint32_t op_handle) = 0;
+
+ virtual psa_status_t key_derivation_key_agreement(
+ uint32_t op_handle,
+ psa_key_derivation_step_t step,
+ psa_key_id_t private_key,
+ const uint8_t *peer_key, size_t peer_key_length) = 0;
+
+ virtual psa_status_t raw_key_agreement(psa_algorithm_t alg,
+ psa_key_id_t private_key,
+ const uint8_t *peer_key, size_t peer_key_length,
+ uint8_t *output, size_t output_size, size_t *output_length) = 0;
protected:
crypto_client();