| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
name: CT Test |
| 6 |
description: Builds the library with given flags and runs Valgrind-based constant-time tests |
| 7 |
|
| 8 |
inputs: |
| 9 |
cflags: |
| 10 |
description: CFLAGS to pass to compilation |
| 11 |
default: "" |
| 12 |
valgrind_flags: |
| 13 |
description: Extra flags to pass to valgrind |
| 14 |
default: "" |
| 15 |
|
| 16 |
runs: |
| 17 |
using: composite |
| 18 |
steps: |
| 19 |
- name: System info |
| 20 |
shell: ${{ env.SHELL }} |
| 21 |
run: | |
| 22 |
ARCH=$(uname -m) |
| 23 |
echo <<-EOF |
| 24 |
## Setup |
| 25 |
Architecture: $ARCH |
| 26 |
- $(uname -a) |
| 27 |
- $(nix --version || echo 'nix not present') |
| 28 |
- $(bash --version | grep -m1 "") |
| 29 |
- $(python3 --version) |
| 30 |
- $(${{ inputs.cross_prefix }}${CC} --version | grep -m1 "") |
| 31 |
EOF |
| 32 |
cat >> $GITHUB_STEP_SUMMARY <<-EOF |
| 33 |
## Setup |
| 34 |
Architecture: $ARCH |
| 35 |
- $(uname -a) |
| 36 |
- $(nix --version || echo 'nix not present') |
| 37 |
- $(bash --version | grep -m1 "") |
| 38 |
- $(python3 --version) |
| 39 |
- $(${{ inputs.cross_prefix }}${CC} --version | grep -m1 "") |
| 40 |
EOF |
| 41 |
- shell: ${{ env.SHELL }} |
| 42 |
run: | |
| 43 |
make clean |
| 44 |
# --vex-guest-max-insns=55 (default is 60) is a workaround for |
| 45 |
# "VEX temporary storage exhausted" errors in the x86 backend (poly_chknorm) |
| 46 |
# It may increase run-time of the valgrind tests. |
| 47 |
# TODO: Check with future versions of valgrind if this is still needed (both 3.24 and 3.25 fail without) |
| 48 |
# TODO: Check if this is still needed once the poly_chknorm intrinsics implementation is replaced by assembly |
| 49 |
# Disable the AArch64 SHA3 extension as it's not yet supported by valgrind |
| 50 |
MK_COMPILER_SUPPORTS_SHA3=0 tests func --exec-wrapper="valgrind --vex-guest-max-insns=55 --error-exitcode=1 ${{ inputs.valgrind_flags }}" --cflags="-DMLD_CONFIG_CT_TESTING_ENABLED -DNTESTS=5 ${{ inputs.cflags }}" |