1Upstream-Status: Pending [Not submitted to upstream yet] 2Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com> 3 4From c1bcab09bb5b73e0f7131d9433f5e23c3943f007 Mon Sep 17 00:00:00 2001 5From: Satish Kumar <satish.kumar01@arm.com> 6Date: Sat, 11 Dec 2021 11:06:57 +0000 7Subject: [PATCH] corstone1000: port crypto config 8 9 10Signed-off-by: Satish Kumar <satish.kumar01@arm.com> 11 12 13Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> 14--- 15 .../nspe/pal_crypto_config.h | 81 +++++++++++++++---- 16 1 file changed, 65 insertions(+), 16 deletions(-) 17 18diff --git a/api-tests/platform/targets/tgt_dev_apis_linux/nspe/pal_crypto_config.h b/api-tests/platform/targets/tgt_dev_apis_linux/nspe/pal_crypto_config.h 19index 218a94c69502..c6d4aadd8476 100755 20--- a/api-tests/platform/targets/tgt_dev_apis_linux/nspe/pal_crypto_config.h 21+++ b/api-tests/platform/targets/tgt_dev_apis_linux/nspe/pal_crypto_config.h 22@@ -34,10 +34,14 @@ 23 * 24 * Comment macros to disable the types 25 */ 26+#ifndef TF_M_PROFILE_SMALL 27+#ifndef TF_M_PROFILE_MEDIUM 28 #define ARCH_TEST_RSA 29 #define ARCH_TEST_RSA_1024 30 #define ARCH_TEST_RSA_2048 31 #define ARCH_TEST_RSA_3072 32+#endif 33+#endif 34 35 /** 36 * \def ARCH_TEST_ECC 37@@ -50,11 +54,17 @@ 38 * Requires: ARCH_TEST_ECC 39 * Comment macros to disable the curve 40 */ 41+#ifndef TF_M_PROFILE_SMALL 42 #define ARCH_TEST_ECC 43 #define ARCH_TEST_ECC_CURVE_SECP192R1 44+#ifndef TF_M_PROFILE_MEDIUM 45 #define ARCH_TEST_ECC_CURVE_SECP224R1 46+#endif 47 #define ARCH_TEST_ECC_CURVE_SECP256R1 48+#ifndef TF_M_PROFILE_MEDIUM 49 #define ARCH_TEST_ECC_CURVE_SECP384R1 50+#endif 51+#endif 52 53 /** 54 * \def ARCH_TEST_AES 55@@ -78,10 +88,10 @@ 56 * 57 * Comment macros to disable the types 58 */ 59-#define ARCH_TEST_DES 60-#define ARCH_TEST_DES_1KEY 61-#define ARCH_TEST_DES_2KEY 62-#define ARCH_TEST_DES_3KEY 63+//#define ARCH_TEST_DES 64+//#define ARCH_TEST_DES_1KEY 65+//#define ARCH_TEST_DES_2KEY 66+//#define ARCH_TEST_DES_3KEY 67 68 /** 69 * \def ARCH_TEST_RAW 70@@ -104,7 +114,7 @@ 71 * 72 * Enable the ARC4 key type. 73 */ 74-#define ARCH_TEST_ARC4 75+//#define ARCH_TEST_ARC4 76 77 /** 78 * \def ARCH_TEST_CIPHER_MODE_CTR 79@@ -113,7 +123,11 @@ 80 * 81 * Requires: ARCH_TEST_CIPHER 82 */ 83+#ifndef TF_M_PROFILE_SMALL 84+#ifndef TF_M_PROFILE_MEDIUM 85 #define ARCH_TEST_CIPHER_MODE_CTR 86+#endif 87+#endif 88 89 /** 90 * \def ARCH_TEST_CIPHER_MODE_CFB 91@@ -138,7 +152,11 @@ 92 * 93 * Requires: ARCH_TEST_CIPHER, ARCH_TEST_AES, ARCH_TEST_CIPHER_MODE_CTR 94 */ 95+#ifndef TF_M_PROFILE_SMALL 96+#ifndef TF_M_PROFILE_MEDIUM 97 #define ARCH_TEST_CTR_AES 98+#endif 99+#endif 100 101 /** 102 * \def ARCH_TEST_CBC_AES 103@@ -157,7 +175,11 @@ 104 * 105 * Comment macros to disable the types 106 */ 107+#ifndef TF_M_PROFILE_SMALL 108+#ifndef TF_M_PROFILE_MEDIUM 109 #define ARCH_TEST_CBC_NO_PADDING 110+#endif 111+#endif 112 113 /** 114 * \def ARCH_TEST_CFB_AES 115@@ -177,11 +199,15 @@ 116 * 117 * Comment macros to disable the types 118 */ 119+#ifndef TF_M_PROFILE_SMALL 120+#ifndef TF_M_PROFILE_MEDIUM 121 #define ARCH_TEST_PKCS1V15 122 #define ARCH_TEST_RSA_PKCS1V15_SIGN 123 #define ARCH_TEST_RSA_PKCS1V15_SIGN_RAW 124 #define ARCH_TEST_RSA_PKCS1V15_CRYPT 125 #define ARCH_TEST_RSA_OAEP 126+#endif 127+#endif 128 129 /** 130 * \def ARCH_TEST_CBC_PKCS7 131@@ -190,7 +216,11 @@ 132 * 133 * Comment macros to disable the types 134 */ 135+#ifndef TF_M_PROFILE_SMALL 136+#ifndef TF_M_PROFILE_MEDIUM 137 #define ARCH_TEST_CBC_PKCS7 138+#endif 139+#endif 140 141 /** 142 * \def ARCH_TEST_ASYMMETRIC_ENCRYPTION 143@@ -227,21 +257,27 @@ 144 * 145 * Comment macros to disable the types 146 */ 147-// #define ARCH_TEST_MD2 148-// #define ARCH_TEST_MD4 149-#define ARCH_TEST_MD5 150-#define ARCH_TEST_RIPEMD160 151-#define ARCH_TEST_SHA1 152+//#define ARCH_TEST_MD2 153+//#define ARCH_TEST_MD4 154+//#define ARCH_TEST_MD5 155+//#define ARCH_TEST_RIPEMD160 156+//#define ARCH_TEST_SHA1 157+#ifndef TF_M_PROFILE_SMALL 158 #define ARCH_TEST_SHA224 159+#endif 160 #define ARCH_TEST_SHA256 161+#ifndef TF_M_PROFILE_SMALL 162+#ifndef TF_M_PROFILE_MEDIUM 163 #define ARCH_TEST_SHA384 164 #define ARCH_TEST_SHA512 165-// #define ARCH_TEST_SHA512_224 166-// #define ARCH_TEST_SHA512_256 167-// #define ARCH_TEST_SHA3_224 168-// #define ARCH_TEST_SHA3_256 169-// #define ARCH_TEST_SHA3_384 170-// #define ARCH_TEST_SHA3_512 171+#endif 172+#endif 173+//#define ARCH_TEST_SHA512_224 174+//#define ARCH_TEST_SHA512_256 175+//#define ARCH_TEST_SHA3_224 176+//#define ARCH_TEST_SHA3_256 177+//#define ARCH_TEST_SHA3_384 178+//#define ARCH_TEST_SHA3_512 179 180 /** 181 * \def ARCH_TEST_HKDF 182@@ -270,7 +306,12 @@ 183 * 184 * Comment macros to disable the types 185 */ 186+#ifndef TF_M_PROFILE_SMALL 187+#ifndef TF_M_PROFILE_MEDIUM 188 #define ARCH_TEST_CMAC 189+#endif 190+#endif 191+//#define ARCH_TEST_GMAC 192 #define ARCH_TEST_HMAC 193 194 /** 195@@ -290,7 +331,11 @@ 196 * Requires: ARCH_TEST_AES 197 * 198 */ 199+#ifndef TF_M_PROFILE_SMALL 200+#ifndef TF_M_PROFILE_MEDIUM 201 #define ARCH_TEST_GCM 202+#endif 203+#endif 204 205 /** 206 * \def ARCH_TEST_TRUNCATED_MAC 207@@ -309,7 +354,9 @@ 208 * 209 * Requires: ARCH_TEST_ECC 210 */ 211+#ifndef TF_M_PROFILE_SMALL 212 #define ARCH_TEST_ECDH 213+#endif 214 215 /** 216 * \def ARCH_TEST_ECDSA 217@@ -317,7 +364,9 @@ 218 * Enable the elliptic curve DSA library. 219 * Requires: ARCH_TEST_ECC 220 */ 221+#ifndef TF_M_PROFILE_SMALL 222 #define ARCH_TEST_ECDSA 223+#endif 224 225 /** 226 * \def ARCH_TEST_DETERMINISTIC_ECDSA 227-- 2282.38.0 229 230