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