Debian Codegraph @

others/mbedtls/tf-psa-crypto/drivers/pqcp/mldsa-native/.github/actions/config-variations/action.yml

raw symbols SCIP
1 # Copyright (c) The mldsa-native project authors
2 # SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
3
4 name: 'Custom config tests'
5 description: 'Build and test mldsa-native with various custom configs'
6 inputs:
7 gh_token:
8 description: 'GitHub token'
9 required: true
10 tests:
11 description: 'List of tests to run (space-separated IDs) or "all" for all tests. Available IDs: pct-enabled, pct-enabled-broken, reduce-ram, reduce-ram-pct, custom-alloc-heap, custom-zeroize, native-cap-ON, native-cap-OFF, native-cap-ID_AA64PFR1_EL1, native-cap-CPUID_AVX2, no-asm, serial-fips202, custom-randombytes, custom-memcpy, custom-memset, custom-stdlib, nblocks-1, nblocks-4, nblocks-6'
12 required: false
13 default: 'all'
14 opt:
15 description: 'Optimization level to pass to multi-functest'
16 required: false
17 default: 'all'
18 runs:
19 using: 'composite'
20 steps:
21 - name: "PCT enabled"
22 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'pct-enabled') }}
23 uses: ./.github/actions/multi-functest
24 with:
25 gh_token: ${{ inputs.gh_token }}
26 compile_mode: native
27 cflags: "-DMLD_CONFIG_KEYGEN_PCT -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
28 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
29 func: true
30 kat: true
31 acvp: true
32 opt: ${{ inputs.opt }}
33 examples: true
34 extra_args: "--exclude-example basic_deterministic"
35 - name: "REDUCE_RAM"
36 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'reduce-ram') }}
37 uses: ./.github/actions/multi-functest
38 with:
39 gh_token: ${{ inputs.gh_token }}
40 compile_mode: native
41 cflags: "-DMLD_CONFIG_REDUCE_RAM -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
42 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
43 func: true
44 kat: true
45 acvp: true
46 alloc: true
47 opt: ${{ inputs.opt }}
48 examples: true
49 - name: "REDUCE_RAM + PCT"
50 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'reduce-ram-pct') }}
51 uses: ./.github/actions/multi-functest
52 with:
53 gh_token: ${{ inputs.gh_token }}
54 compile_mode: native
55 cflags: "-DMLD_CONFIG_REDUCE_RAM -DMLD_CONFIG_KEYGEN_PCT -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
56 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
57 func: true
58 kat: true
59 acvp: true
60 alloc: true
61 opt: ${{ inputs.opt }}
62 examples: true
63 extra_args: "--exclude-example basic_deterministic"
64 - name: "PCT enabled + broken"
65 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'pct-enabled-broken') }}
66 shell: bash
67 run: |
68 make clean
69 CFLAGS='-Itest -DMLD_CONFIG_FILE=\"configs/break_pct_config.h\"' make func -j4
70 # PCT breakage is done at runtime via MLD_BREAK_PCT
71 make run_func # Should be OK
72 MLD_BREAK_PCT=0 make run_func # Should be OK
73 if (MLD_BREAK_PCT=1 make run_func 2>&1 >/dev/null); then
74 echo "PCT failure expected"
75 exit 1
76 else
77 echo "PCT failed as expected"
78 fi
79 - name: "Custom allocation (heap based)"
80 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'custom-alloc-heap') }}
81 uses: ./.github/actions/multi-functest
82 with:
83 gh_token: ${{ inputs.gh_token }}
84 compile_mode: native
85 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_heap_alloc_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
86 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
87 func: true
88 kat: true
89 acvp: true
90 opt: ${{ inputs.opt }}
91 extra_env: 'ASAN_OPTIONS=detect_leaks=1'
92 examples: false # Some examples use a custom config themselves
93 alloc: false # Requires custom config
94 rng_fail: false # Requires custom config
95 - name: "Custom zeroization (explicit_bzero)"
96 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'custom-zeroize') }}
97 uses: ./.github/actions/multi-functest
98 with:
99 gh_token: ${{ inputs.gh_token }}
100 compile_mode: native
101 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_zeroize_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
102 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
103 func: true
104 kat: true
105 acvp: true
106 opt: ${{ inputs.opt }}
107 examples: false # Some examples use a custom config themselves
108 alloc: false # Requires custom config
109 rng_fail: false # Requires custom config
110 - name: "Custom native capability functions (static ON)"
111 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'native-cap-ON') }}
112 uses: ./.github/actions/multi-functest
113 with:
114 gh_token: ${{ inputs.gh_token }}
115 compile_mode: native
116 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_native_capability_config_1.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
117 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
118 func: true
119 kat: true
120 acvp: true
121 opt: ${{ inputs.opt }}
122 examples: false # Some examples use a custom config themselves
123 alloc: false # Requires custom config
124 rng_fail: false # Requires custom config
125 - name: "Custom native capability functions (static OFF)"
126 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'native-cap-OFF') }}
127 uses: ./.github/actions/multi-functest
128 with:
129 gh_token: ${{ inputs.gh_token }}
130 compile_mode: native
131 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_native_capability_config_0.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
132 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
133 func: true
134 kat: true
135 acvp: true
136 opt: ${{ inputs.opt }}
137 examples: false # Some examples use a custom config themselves
138 alloc: false # Requires custom config
139 rng_fail: false # Requires custom config
140 - name: "Custom native capability functions (ID_AA64PFR1_EL1 detection)"
141 if: ${{ (inputs.tests == 'all' || contains(inputs.tests, 'native-cap-ID_AA64PFR1_EL1')) && runner.os == 'Linux' && runner.arch == 'ARM64' }}
142 uses: ./.github/actions/multi-functest
143 with:
144 gh_token: ${{ inputs.gh_token }}
145 compile_mode: native
146 cflags: "-std=c11 -march=armv8.4-a+sha3 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_native_capability_config_ID_AA64PFR1_EL1.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
147 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
148 func: true
149 kat: true
150 acvp: true
151 opt: ${{ inputs.opt }}
152 examples: false # Some examples use a custom config themselves
153 alloc: false # Requires custom config
154 rng_fail: false # Requires custom config
155 - name: "Custom native capability functions (CPUID AVX2 detection)"
156 if: ${{ (inputs.tests == 'all' || contains(inputs.tests, 'native-cap-CPUID_AVX2')) && runner.os == 'Linux' && runner.arch == 'X64' }}
157 uses: ./.github/actions/multi-functest
158 with:
159 gh_token: ${{ inputs.gh_token }}
160 compile_mode: native
161 cflags: "-std=c11 -mavx2 -mbmi2 -mpopcnt -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_native_capability_config_CPUID_AVX2.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
162 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
163 func: true
164 kat: true
165 acvp: true
166 opt: ${{ inputs.opt }}
167 examples: false # Some examples use a custom config themselves
168 alloc: false # Requires custom config
169 rng_fail: false # Requires custom config
170 - name: "No ASM"
171 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'no-asm') }}
172 uses: ./.github/actions/multi-functest
173 with:
174 gh_token: ${{ inputs.gh_token }}
175 compile_mode: native
176 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/no_asm_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
177 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
178 func: true
179 kat: true
180 acvp: true
181 opt: ${{ inputs.opt }}
182 examples: false # Some examples use a custom config themselves
183 alloc: false # Requires custom config
184 rng_fail: false # Requires custom config
185 - name: "Serial FIPS202 (no batched Keccak)"
186 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'serial-fips202') }}
187 uses: ./.github/actions/multi-functest
188 with:
189 gh_token: ${{ inputs.gh_token }}
190 compile_mode: native
191 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/serial_fips202_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
192 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
193 func: true
194 kat: true
195 acvp: true
196 opt: ${{ inputs.opt }}
197 examples: false # Some examples use a custom config themselves
198 alloc: false # Requires custom config
199 rng_fail: false # Requires custom config
200 - name: "Custom randombytes"
201 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'custom-randombytes') }}
202 uses: ./.github/actions/multi-functest
203 with:
204 gh_token: ${{ inputs.gh_token }}
205 compile_mode: native
206 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_randombytes_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
207 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
208 func: true
209 kat: true
210 acvp: true
211 opt: ${{ inputs.opt }}
212 examples: false # Some examples use a custom config themselves
213 alloc: false # Requires custom config
214 rng_fail: false # Requires custom config
215 - name: "Custom memcpy"
216 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'custom-memcpy') }}
217 uses: ./.github/actions/multi-functest
218 with:
219 gh_token: ${{ inputs.gh_token }}
220 compile_mode: native
221 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_memcpy_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
222 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
223 func: true
224 kat: true
225 acvp: true
226 opt: ${{ inputs.opt }}
227 examples: false # Some examples use a custom config themselves
228 alloc: false # Requires custom config
229 rng_fail: false # Requires custom config
230 - name: "Custom memset"
231 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'custom-memset') }}
232 uses: ./.github/actions/multi-functest
233 with:
234 gh_token: ${{ inputs.gh_token }}
235 compile_mode: native
236 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_memset_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
237 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
238 func: true
239 kat: true
240 acvp: true
241 opt: ${{ inputs.opt }}
242 examples: false # Some examples use a custom config themselves
243 alloc: false # Requires custom config
244 rng_fail: false # Requires custom config
245 - name: "Custom stdlib (memcpy + memset)"
246 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'custom-stdlib') }}
247 uses: ./.github/actions/multi-functest
248 with:
249 gh_token: ${{ inputs.gh_token }}
250 compile_mode: native
251 cflags: "-std=c11 -D_GNU_SOURCE -Itest -DMLD_CONFIG_FILE=\\\\\\\"configs/custom_stdlib_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
252 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
253 func: true
254 kat: true
255 acvp: true
256 opt: ${{ inputs.opt }}
257 examples: false # Some examples use a custom config themselves
258 alloc: false # Requires custom config
259 rng_fail: false # Requires custom config
260 - name: "MLD_POLY_UNIFORM_NBLOCKS=1"
261 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'nblocks-1') }}
262 uses: ./.github/actions/multi-functest
263 with:
264 gh_token: ${{ inputs.gh_token }}
265 compile_mode: native
266 cflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -DMLD_POLY_UNIFORM_NBLOCKS=1"
267 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
268 func: true
269 kat: true
270 acvp: true
271 opt: ${{ inputs.opt }}
272 examples: false # Some examples use a custom config themselves
273 alloc: false # Requires custom config
274 rng_fail: false # Requires custom config
275 - name: "MLD_POLY_UNIFORM_NBLOCKS=4"
276 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'nblocks-4') }}
277 uses: ./.github/actions/multi-functest
278 with:
279 gh_token: ${{ inputs.gh_token }}
280 compile_mode: native
281 cflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -DMLD_POLY_UNIFORM_NBLOCKS=4"
282 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
283 func: true
284 kat: true
285 acvp: true
286 opt: ${{ inputs.opt }}
287 examples: false # Some examples use a custom config themselves
288 alloc: false # Requires custom config
289 rng_fail: false # Requires custom config
290 - name: "MLD_POLY_UNIFORM_NBLOCKS=6"
291 if: ${{ inputs.tests == 'all' || contains(inputs.tests, 'nblocks-6') }}
292 uses: ./.github/actions/multi-functest
293 with:
294 gh_token: ${{ inputs.gh_token }}
295 compile_mode: native
296 cflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -DMLD_POLY_UNIFORM_NBLOCKS=6"
297 ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
298 func: true
299 kat: true
300 acvp: true
301 opt: ${{ inputs.opt }}
302 examples: false # Some examples use a custom config themselves
303 alloc: false # Requires custom config
304 rng_fail: false # Requires custom config