Add symmetric cipher service level tests
Adds end-to-end tests for cipher operations implemented by
a crypto service provider.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I37c29095bac452ad7ac24fa44ac3df9b9e29457e
diff --git a/components/service/crypto/client/cpp/crypto_client.h b/components/service/crypto/client/cpp/crypto_client.h
index 68d80ee..2b5a0f0 100644
--- a/components/service/crypto/client/cpp/crypto_client.h
+++ b/components/service/crypto/client/cpp/crypto_client.h
@@ -115,6 +115,39 @@
uint32_t source_op_handle,
uint32_t *target_op_handle) = 0;
+ /* Cipher methods */
+ virtual size_t cipher_max_update_size() const = 0;
+
+ virtual psa_status_t cipher_encrypt_setup(
+ uint32_t *op_handle,
+ psa_key_id_t key,
+ psa_algorithm_t alg) = 0;
+
+ virtual psa_status_t cipher_decrypt_setup(
+ uint32_t *op_handle,
+ psa_key_id_t key,
+ psa_algorithm_t alg) = 0;
+
+ virtual psa_status_t cipher_generate_iv(
+ uint32_t op_handle,
+ uint8_t *iv, size_t iv_size, size_t *iv_length) = 0;
+
+ virtual psa_status_t cipher_set_iv(
+ uint32_t op_handle,
+ const uint8_t *iv, size_t iv_length) = 0;
+
+ virtual psa_status_t cipher_update(
+ uint32_t op_handle,
+ const uint8_t *input, size_t input_length,
+ uint8_t *output, size_t output_size, size_t *output_length) = 0;
+
+ virtual psa_status_t cipher_finish(
+ uint32_t op_handle,
+ uint8_t *output, size_t output_size, size_t *output_length) = 0;
+
+ virtual psa_status_t cipher_abort(
+ uint32_t op_handle) = 0;
+
protected:
crypto_client();
crypto_client(struct rpc_caller *caller);