Extend supported crypto key management operations
Extends the supported key management operations to cover all
PSA API operations related to general key management.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I41945782a8758e10fe56038caaa96aa61b6835c2
diff --git a/protocols/service/crypto/packed-c/copy_key.h b/protocols/service/crypto/packed-c/copy_key.h
new file mode 100644
index 0000000..657e2ac
--- /dev/null
+++ b/protocols/service/crypto/packed-c/copy_key.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef TS_CRYPTO_COPY_KEY_H
+#define TS_CRYPTO_COPY_KEY_H
+
+#include <stdint.h>
+#include "key_attributes.h"
+
+/* Mandatory fixed sized input parameters */
+struct __attribute__ ((__packed__)) ts_crypto_copy_key_in
+{
+ uint32_t source_key_id;
+ struct ts_crypto_key_attributes attributes;
+};
+
+/* Mandatory fixed sized output parameters */
+struct __attribute__ ((__packed__)) ts_crypto_copy_key_out
+{
+ uint32_t target_key_id;
+};
+
+#endif /* TS_CRYPTO_COPY_KEY_H */
diff --git a/protocols/service/crypto/packed-c/get_key_attributes.h b/protocols/service/crypto/packed-c/get_key_attributes.h
new file mode 100644
index 0000000..bd05264
--- /dev/null
+++ b/protocols/service/crypto/packed-c/get_key_attributes.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef TS_CRYPTO_GET_KEY_ATTRIBUTES_H
+#define TS_CRYPTO_GET_KEY_ATTRIBUTES_H
+
+#include <stdint.h>
+#include "key_attributes.h"
+
+/* Mandatory fixed sized input parameters */
+struct __attribute__ ((__packed__)) ts_crypto_get_key_attributes_in
+{
+ uint32_t id;
+};
+
+/* Mandatory fixed sized output parameters */
+struct __attribute__ ((__packed__)) ts_crypto_get_key_attributes_out
+{
+ struct ts_crypto_key_attributes attributes;
+};
+
+#endif /* TS_CRYPTO_GET_KEY_ATTRIBUTES_H */
diff --git a/protocols/service/crypto/packed-c/opcodes.h b/protocols/service/crypto/packed-c/opcodes.h
index 54ee9e9..fa23175 100644
--- a/protocols/service/crypto/packed-c/opcodes.h
+++ b/protocols/service/crypto/packed-c/opcodes.h
@@ -24,5 +24,8 @@
#define TS_CRYPTO_OPCODE_HASH_SETUP (TS_CRYPTO_OPCODE_BASE + 13)
#define TS_CRYPTO_OPCODE_HASH_UPDATE (TS_CRYPTO_OPCODE_BASE + 14)
#define TS_CRYPTO_OPCODE_HASH_FINISH (TS_CRYPTO_OPCODE_BASE + 15)
+#define TS_CRYPTO_OPCODE_COPY_KEY (TS_CRYPTO_OPCODE_BASE + 16)
+#define TS_CRYPTO_OPCODE_PURGE_KEY (TS_CRYPTO_OPCODE_BASE + 17)
+#define TS_CRYPTO_OPCODE_GET_KEY_ATTRIBUTES (TS_CRYPTO_OPCODE_BASE + 18)
#endif /* TS_CRYPTO_OPCODES_H */
diff --git a/protocols/service/crypto/packed-c/purge_key.h b/protocols/service/crypto/packed-c/purge_key.h
new file mode 100644
index 0000000..e3c5601
--- /dev/null
+++ b/protocols/service/crypto/packed-c/purge_key.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef TS_CRYPTO_PURGE_KEY_H
+#define TS_CRYPTO_PURGE_KEY_H
+
+#include <stdint.h>
+
+/* Mandatory fixed sized input parameters */
+struct __attribute__ ((__packed__)) ts_crypto_purge_key_in
+{
+ uint32_t id;
+};
+
+#endif /* TS_CRYPTO_PURGE_KEY_H */