summaryrefslogtreecommitdiff
path: root/meta-arm/meta-arm-bsp/recipes-security/trusted-services/corstone1000/ts-psa-crypto-api-test/0001-corstone1000-port-crypto-config.patch
blob: c7289562bd0cf875d94ba141b3f7d2e91d846c00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>

From c1bcab09bb5b73e0f7131d9433f5e23c3943f007 Mon Sep 17 00:00:00 2001
From: Satish Kumar <satish.kumar01@arm.com>
Date: Sat, 11 Dec 2021 11:06:57 +0000
Subject: [PATCH] corstone1000: port crypto config


Signed-off-by: Satish Kumar <satish.kumar01@arm.com>

%% original patch: 0002-corstone1000-port-crypto-config.patch

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
 .../nspe/pal_crypto_config.h                  | 81 +++++++++++++++----
 1 file changed, 65 insertions(+), 16 deletions(-)

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
index 218a94c69502..c6d4aadd8476 100755
--- 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
@@ -34,10 +34,14 @@
  *
  * Comment macros to disable the types
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_RSA
 #define ARCH_TEST_RSA_1024
 #define ARCH_TEST_RSA_2048
 #define ARCH_TEST_RSA_3072
+#endif
+#endif
 
 /**
  * \def  ARCH_TEST_ECC
@@ -50,11 +54,17 @@
  * Requires: ARCH_TEST_ECC
  * Comment macros to disable the curve
  */
+#ifndef TF_M_PROFILE_SMALL
 #define ARCH_TEST_ECC
 #define ARCH_TEST_ECC_CURVE_SECP192R1
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_ECC_CURVE_SECP224R1
+#endif
 #define ARCH_TEST_ECC_CURVE_SECP256R1
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_ECC_CURVE_SECP384R1
+#endif
+#endif
 
 /**
  * \def ARCH_TEST_AES
@@ -78,10 +88,10 @@
  *
  * Comment macros to disable the types
  */
-#define ARCH_TEST_DES
-#define ARCH_TEST_DES_1KEY
-#define ARCH_TEST_DES_2KEY
-#define ARCH_TEST_DES_3KEY
+//#define ARCH_TEST_DES
+//#define ARCH_TEST_DES_1KEY
+//#define ARCH_TEST_DES_2KEY
+//#define ARCH_TEST_DES_3KEY
 
 /**
  * \def  ARCH_TEST_RAW
@@ -104,7 +114,7 @@
  *
  * Enable the ARC4 key type.
  */
-#define ARCH_TEST_ARC4
+//#define ARCH_TEST_ARC4
 
 /**
  * \def ARCH_TEST_CIPHER_MODE_CTR
@@ -113,7 +123,11 @@
  *
  * Requires: ARCH_TEST_CIPHER
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_CIPHER_MODE_CTR
+#endif
+#endif
 
 /**
  * \def ARCH_TEST_CIPHER_MODE_CFB
@@ -138,7 +152,11 @@
  *
  * Requires: ARCH_TEST_CIPHER, ARCH_TEST_AES, ARCH_TEST_CIPHER_MODE_CTR
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_CTR_AES
+#endif
+#endif
 
 /**
  * \def ARCH_TEST_CBC_AES
@@ -157,7 +175,11 @@
  *
  * Comment macros to disable the types
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_CBC_NO_PADDING
+#endif
+#endif
 
 /**
  * \def ARCH_TEST_CFB_AES
@@ -177,11 +199,15 @@
  *
  * Comment macros to disable the types
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_PKCS1V15
 #define ARCH_TEST_RSA_PKCS1V15_SIGN
 #define ARCH_TEST_RSA_PKCS1V15_SIGN_RAW
 #define ARCH_TEST_RSA_PKCS1V15_CRYPT
 #define ARCH_TEST_RSA_OAEP
+#endif
+#endif
 
 /**
  * \def ARCH_TEST_CBC_PKCS7
@@ -190,7 +216,11 @@
  *
  * Comment macros to disable the types
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_CBC_PKCS7
+#endif
+#endif
 
 /**
  * \def ARCH_TEST_ASYMMETRIC_ENCRYPTION
@@ -227,21 +257,27 @@
  *
  * Comment macros to disable the types
  */
-// #define ARCH_TEST_MD2
-// #define ARCH_TEST_MD4
-#define ARCH_TEST_MD5
-#define ARCH_TEST_RIPEMD160
-#define ARCH_TEST_SHA1
+//#define ARCH_TEST_MD2
+//#define ARCH_TEST_MD4
+//#define ARCH_TEST_MD5
+//#define ARCH_TEST_RIPEMD160
+//#define ARCH_TEST_SHA1
+#ifndef TF_M_PROFILE_SMALL
 #define ARCH_TEST_SHA224
+#endif
 #define ARCH_TEST_SHA256
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_SHA384
 #define ARCH_TEST_SHA512
-// #define ARCH_TEST_SHA512_224
-// #define ARCH_TEST_SHA512_256
-// #define ARCH_TEST_SHA3_224
-// #define ARCH_TEST_SHA3_256
-// #define ARCH_TEST_SHA3_384
-// #define ARCH_TEST_SHA3_512
+#endif
+#endif
+//#define ARCH_TEST_SHA512_224
+//#define ARCH_TEST_SHA512_256
+//#define ARCH_TEST_SHA3_224
+//#define ARCH_TEST_SHA3_256
+//#define ARCH_TEST_SHA3_384
+//#define ARCH_TEST_SHA3_512
 
 /**
  * \def ARCH_TEST_HKDF
@@ -270,7 +306,12 @@
  *
  * Comment macros to disable the types
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_CMAC
+#endif
+#endif
+//#define ARCH_TEST_GMAC
 #define ARCH_TEST_HMAC
 
 /**
@@ -290,7 +331,11 @@
  * Requires: ARCH_TEST_AES
  *
  */
+#ifndef TF_M_PROFILE_SMALL
+#ifndef TF_M_PROFILE_MEDIUM
 #define ARCH_TEST_GCM
+#endif
+#endif
 
 /**
  * \def ARCH_TEST_TRUNCATED_MAC
@@ -309,7 +354,9 @@
  *
  * Requires: ARCH_TEST_ECC
  */
+#ifndef TF_M_PROFILE_SMALL
 #define ARCH_TEST_ECDH
+#endif
 
 /**
  * \def ARCH_TEST_ECDSA
@@ -317,7 +364,9 @@
  * Enable the elliptic curve DSA library.
  * Requires: ARCH_TEST_ECC
  */
+#ifndef TF_M_PROFILE_SMALL
 #define ARCH_TEST_ECDSA
+#endif
 
 /**
  * \def ARCH_TEST_DETERMINISTIC_ECDSA
-- 
2.38.0