Repository navigation
87 lines (85 loc) · 3.31 KB
/
Copy pathct-tests.yml
File metadata and controls
87 lines (85 loc) · 3.31 KB
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
# Copyright (c) The mlkem-native project authors
# Copyright (c) The mldsa-native project authors
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
name: Constant-time tests
permissions:
contents: read
on:
workflow_call:
workflow_dispatch:
jobs:
check-ct-varlat:
# Using the patched Valgrind from the KyberSlash paper to detect divisions
# In case the patch no longer applies after an update, we may want to switch back
# to stock valgrind added in https://github.com/pq-code-package/mlkem-native/pull/687
name: CT test ${{ matrix.nix-shell }} ${{ matrix.system }}
strategy:
fail-fast: false
max-parallel: 10
matrix:
system: [ubuntu-latest, ubuntu-24.04-arm]
# Oldest available + 3 latest per family; intermediate versions run in legacy-compilers.
nix-shell:
- valgrind-varlat_clang6
- valgrind-varlat_clang21
- valgrind-varlat_clang22
- valgrind-varlat_clang23
- valgrind-varlat_gcc48
- valgrind-varlat_gcc14
- valgrind-varlat_gcc15
- valgrind-varlat_gcc16
runs-on: ${{ matrix.system }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup nix
uses: ./.github/actions/setup-shell
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
nix-shell: ${{ matrix.nix-shell }}
nix-cache: true
- name: Build and run test (-Oz)
# -Oz got introduced in gcc12
if: ${{ matrix.nix-shell != 'valgrind-varlat_gcc48' }}
uses: ./.github/actions/ct-test
with:
cflags: -Oz -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-Os)
uses: ./.github/actions/ct-test
with:
cflags: -Os -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O3)
uses: ./.github/actions/ct-test
with:
cflags: -O3 -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-Ofast)
# -Ofast got deprecated in clang19; -O3 -ffast-math should be used instead
if: ${{ !startsWith(matrix.nix-shell, 'valgrind-varlat_clang') || matrix.nix-shell == 'valgrind-varlat_clang6' }}
uses: ./.github/actions/ct-test
with:
cflags: -Ofast -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O3 -ffast-math)
uses: ./.github/actions/ct-test
with:
cflags: -O3 -ffast-math -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O2)
uses: ./.github/actions/ct-test
with:
cflags: -O2 -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O1)
uses: ./.github/actions/ct-test
with:
cflags: -O1 -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O0)
uses: ./.github/actions/ct-test
with:
cflags: -O0 -DMLD_CONFIG_KEYGEN_PCT
valgrind_flags: --variable-latency-errors=yes