Crypto: Add Crypto service
This change introduces the implementation of the Crypto
service based on the interface psa_crypto.h
This patch introduces changes for:
-- Secure Service, including manifest
-- Platform
-- Non-Secure interface
Change-Id: I3b68266ca80f4cd2bda2a1cd2b28b51c654b4c59
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/interface/include/crypto_psa_wrappers.h b/interface/include/crypto_psa_wrappers.h
new file mode 100644
index 0000000..c337962
--- /dev/null
+++ b/interface/include/crypto_psa_wrappers.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __CRYPTO_PSA_WRAPPERS_H__
+#define __CRYPTO_PSA_WRAPPERS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*!
+ * \struct psa_cipher_update_input
+ *
+ * \brief Input structure for the tfm_crypto_cipher_update_wrapper function
+ *
+ */
+struct psa_cipher_update_input {
+ const uint8_t *input; /*!< Input data to the cipher */
+ size_t input_length; /*!< Size of the input data */
+};
+
+/*!
+ * \struct psa_cipher_update_output
+ *
+ * \brief Output structure for the tfm_crypto_cipher_update_wrapper function
+ *
+ */
+struct psa_cipher_update_output {
+ unsigned char *output; /*!< Buffer to hold the output data from the cipher*/
+ size_t output_size; /*!< Size of the output buffer */
+ size_t *output_length; /*!< Size of the output data from the cipher */
+};
+
+/*!
+ * \brief This function is a TF-M compatible wrapper for the
+ * \ref tfm_crypto_cipher_update implemented in the Crypto service
+ *
+ * \param[in] input_s Pointer to the structure containing input parameters
+ * associated with \ref psa_cipher_update_input
+ * \param[out] output_s Pointer to the structure containing output parameters
+ * associated with \ref psa_cipher_update_output
+ *
+ */
+enum tfm_crypto_err_t tfm_crypto_cipher_update_wrapper(
+ psa_cipher_operation_t *operation,
+ struct psa_cipher_update_input *input_s,
+ struct psa_cipher_update_output *output_s);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CRYPTO_PSA_WRAPPERS_H__ */