CC312: XXX_ALT is not needed when use PSA driver
XXX_ALT is not needed when CC312 use PSA driver.
Use PSA driver for CC3XX driver to avoid fallback to software
implementation which will save 7.85KB in ROM size.
Signed-off-by: Summer Qin <summer.qin@arm.com>
Change-Id: I7f4b7497f8e6513718423d3b69d37b5f0fd9a1b0
diff --git a/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch b/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch
index ef08482..f7a8c24 100644
--- a/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch
+++ b/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch
@@ -1,7 +1,7 @@
-From 86f1cd6dc04ed5141b54a0a72f63d209f7a04655 Mon Sep 17 00:00:00 2001
+From 52c3af7597167c84168a73700315b65dcc4771ce Mon Sep 17 00:00:00 2001
From: Summer Qin <summer.qin@arm.com>
Date: Mon, 11 Apr 2022 11:20:35 +0800
-Subject: [PATCH 1/3] Init non-volatile memory before using in an521 dev apis
+Subject: [PATCH 1/4] Init non-volatile memory before using in an521 dev apis
psa arch test read data from non-volatile memory directly
without initializing it. The data maybe randomly which may
diff --git a/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch b/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
index 752fca0..0bebd0c 100644
--- a/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
+++ b/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
@@ -1,7 +1,7 @@
-From 534d847765c669f307c93b03384bad7e1cb919b3 Mon Sep 17 00:00:00 2001
+From fe20f1185ef25986eb704074b1a12ddb40303b95 Mon Sep 17 00:00:00 2001
From: Summer Qin <summer.qin@arm.com>
Date: Fri, 10 Jun 2022 10:13:43 +0800
-Subject: [PATCH 2/3] Disable obsolete algorithms
+Subject: [PATCH 2/4] Disable obsolete algorithms
curves of size <255 are obsolete algorithms, should be disabled.
diff --git a/lib/ext/psa_arch_tests/0003-Fix-2-issues-in-FF-test.patch b/lib/ext/psa_arch_tests/0003-Fix-2-issues-in-FF-test.patch
index fd2e472..abedd32 100644
--- a/lib/ext/psa_arch_tests/0003-Fix-2-issues-in-FF-test.patch
+++ b/lib/ext/psa_arch_tests/0003-Fix-2-issues-in-FF-test.patch
@@ -1,7 +1,7 @@
-From d205709b36671c774b996de1dab815108dc74f8f Mon Sep 17 00:00:00 2001
+From 1f7a61b48ec3c6ac8cbefc1c4a49e40477f3ae00 Mon Sep 17 00:00:00 2001
From: Summer Qin <summer.qin@arm.com>
Date: Fri, 17 Jun 2022 15:42:55 +0800
-Subject: [PATCH 3/3] Fix 2 issues in FF test
+Subject: [PATCH 3/4] Fix 2 issues in FF test
- Disable secure test when testing version policy. Otherwise, the
received signal is not matched.
diff --git a/lib/ext/psa_arch_tests/0004-SHA-384-and-SHA-512-are-not-supported-in-CC3XX-PSA-d.patch b/lib/ext/psa_arch_tests/0004-SHA-384-and-SHA-512-are-not-supported-in-CC3XX-PSA-d.patch
new file mode 100644
index 0000000..2ff6783
--- /dev/null
+++ b/lib/ext/psa_arch_tests/0004-SHA-384-and-SHA-512-are-not-supported-in-CC3XX-PSA-d.patch
@@ -0,0 +1,66 @@
+From 3a624e3ed4d87498d750908b840ad471319b52b9 Mon Sep 17 00:00:00 2001
+From: Summer Qin <summer.qin@arm.com>
+Date: Wed, 13 Jul 2022 10:29:26 +0800
+Subject: [PATCH 4/4] SHA-384 and SHA-512 are not supported in CC3XX PSA driver
+
+For psa arch crypto test, SHA-384 and SHA-512 are not supported
+in CC3XX PSA driver.
+
+Signed-off-by: Summer Qin <summer.qin@arm.com>
+---
+ api-tests/CMakeLists.txt | 3 +++
+ .../targets/tgt_dev_apis_tfm_musca_b1/nspe/pal_crypto_config.h | 2 ++
+ .../targets/tgt_dev_apis_tfm_musca_s1/nspe/pal_crypto_config.h | 2 ++
+ 3 files changed, 7 insertions(+)
+
+diff --git a/api-tests/CMakeLists.txt b/api-tests/CMakeLists.txt
+index 55c456b..618a775 100644
+--- a/api-tests/CMakeLists.txt
++++ b/api-tests/CMakeLists.txt
+@@ -641,6 +641,9 @@ endif()
+ if(${SP_HEAP_MEM_SUPP} EQUAL 1)
+ add_definitions(-DSP_HEAP_MEM_SUPP)
+ endif()
++if(${CC312_LEGACY_DRIVER_API_ENABLED})
++ add_definitions(-DCC312_LEGACY_DRIVER_API_ENABLED)
++endif()
+
+ # Build PAL NSPE LIB
+ include(${PSA_ROOT_DIR}/platform/targets/${TARGET}/target.cmake)
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_musca_b1/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_musca_b1/nspe/pal_crypto_config.h
+index 10ee013..1ec1e0c 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_musca_b1/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_musca_b1/nspe/pal_crypto_config.h
+@@ -271,10 +271,12 @@
+ #define ARCH_TEST_SHA256
+ #ifndef TF_M_PROFILE_SMALL
+ #ifndef TF_M_PROFILE_MEDIUM
++#ifdef CC312_LEGACY_DRIVER_API_ENABLED
+ #define ARCH_TEST_SHA384
+ #define ARCH_TEST_SHA512
+ #endif
+ #endif
++#endif
+ //#define ARCH_TEST_SHA512_224
+ //#define ARCH_TEST_SHA512_256
+ //#define ARCH_TEST_SHA3_224
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_musca_s1/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_musca_s1/nspe/pal_crypto_config.h
+index 92f73d9..bc38f16 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_musca_s1/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_musca_s1/nspe/pal_crypto_config.h
+@@ -271,10 +271,12 @@
+ #define ARCH_TEST_SHA256
+ #ifndef TF_M_PROFILE_SMALL
+ #ifndef TF_M_PROFILE_MEDIUM
++#ifdef CC312_LEGACY_DRIVER_API_ENABLED
+ #define ARCH_TEST_SHA384
+ #define ARCH_TEST_SHA512
+ #endif
+ #endif
++#endif
+ //#define ARCH_TEST_SHA512_224
+ //#define ARCH_TEST_SHA512_256
+ //#define ARCH_TEST_SHA3_224
+--
+2.17.1
+