Crypto: Use new style PSA config
Switch to use new style PSA config which can enable HW accelerator
to use PSA drivers and get rid of Mbed TLS software implementation.
Therefore, it can decrease the crypto software code size for HW
accelerator.
Signed-off-by: Summer Qin <summer.qin@arm.com>
Change-Id: I2dda32edb6dd3573278409d5ed00d3af0307ebe5
diff --git a/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch b/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
new file mode 100644
index 0000000..306deac
--- /dev/null
+++ b/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
@@ -0,0 +1,149 @@
+From 95e75d02190282825be4c5e9e73a8c4cc71bb042 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/2] Disable obsolete algorithms
+
+curves of size <255 are obsolete algorithms, should be disabled.
+
+Signed-off-by: Summer Qin <summer.qin@arm.com>
+---
+ .../targets/tgt_dev_apis_tfm_an521/nspe/pal_crypto_config.h | 3 +++
+ .../targets/tgt_dev_apis_tfm_an524/nspe/pal_crypto_config.h | 3 +++
+ .../targets/tgt_dev_apis_tfm_an539/nspe/pal_crypto_config.h | 3 +++
+ .../targets/tgt_dev_apis_tfm_musca_b1/nspe/pal_crypto_config.h | 3 +++
+ .../targets/tgt_dev_apis_tfm_musca_s1/nspe/pal_crypto_config.h | 3 +++
+ .../targets/tgt_dev_apis_tfm_nrf5340/nspe/pal_crypto_config.h | 3 +++
+ .../targets/tgt_dev_apis_tfm_nrf9160/nspe/pal_crypto_config.h | 3 +++
+ .../targets/tgt_dev_apis_tfm_psoc64/nspe/pal_crypto_config.h | 3 +++
+ .../tgt_dev_apis_tfm_stm32l562e_dk/nspe/pal_crypto_config.h | 3 +++
+ 9 files changed, 27 insertions(+)
+
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_an521/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_an521/nspe/pal_crypto_config.h
+index 2642abd..10ee013 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_an521/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_an521/nspe/pal_crypto_config.h
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_an524/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_an524/nspe/pal_crypto_config.h
+index 2642abd..10ee013 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_an524/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_an524/nspe/pal_crypto_config.h
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_an539/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_an539/nspe/pal_crypto_config.h
+index f3a117b..92f73d9 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_an539/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_an539/nspe/pal_crypto_config.h
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+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 2642abd..10ee013 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
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+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 f3a117b..92f73d9 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
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_nrf5340/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_nrf5340/nspe/pal_crypto_config.h
+index 2642abd..10ee013 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_nrf5340/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_nrf5340/nspe/pal_crypto_config.h
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_nrf9160/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_nrf9160/nspe/pal_crypto_config.h
+index 2642abd..10ee013 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_nrf9160/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_nrf9160/nspe/pal_crypto_config.h
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_psoc64/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_psoc64/nspe/pal_crypto_config.h
+index d90fe31..ca0a6f4 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_psoc64/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_psoc64/nspe/pal_crypto_config.h
+@@ -66,6 +66,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+diff --git a/api-tests/platform/targets/tgt_dev_apis_tfm_stm32l562e_dk/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_tfm_stm32l562e_dk/nspe/pal_crypto_config.h
+index 2642abd..10ee013 100644
+--- a/api-tests/platform/targets/tgt_dev_apis_tfm_stm32l562e_dk/nspe/pal_crypto_config.h
++++ b/api-tests/platform/targets/tgt_dev_apis_tfm_stm32l562e_dk/nspe/pal_crypto_config.h
+@@ -65,6 +65,9 @@
+ #define ARCH_TEST_ECC_CURVE_SECP384R1
+ #endif
+ #endif
++/* curves of size <255 are obsolete algorithms, should be disabled. */
++#undef ARCH_TEST_ECC_CURVE_SECP192R1
++#undef ARCH_TEST_ECC_CURVE_SECP224R1
+
+ /**
+ * \def ARCH_TEST_AES
+--
+2.17.1
+