Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/bench/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
archflags:
description: ARCHFLAGS to pass to compilation
default: ""
ldflags:
description: LDFLAGS to pass to compilation
default: ""
opt:
description: opt flag to set for tests script
default: "true"
Expand Down Expand Up @@ -75,11 +78,13 @@ runs:
run: |
./scripts/tests bench -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
--cflags="${{ inputs.cflags }} ${{ inputs.archflags }}" \
--ldflags="${{ inputs.ldflags }}" \
--opt=$([[ ${{ inputs.opt }} == "false" ]] && echo "no_opt" || echo "opt") \
-v --output=output.json ${{ inputs.bench_extra_args }}
./scripts/tests bench --components -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
--cflags="${{ inputs.cflags }} ${{ inputs.archflags }}" \
--ldflags="${{ inputs.ldflags }}" \
--opt=$([[ ${{ inputs.opt }} == "false" ]] && echo "no_opt" || echo "opt") \
-v ${{ inputs.bench_extra_args }}
- name: Check namespace
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/config-variations/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-DMLK_CONFIG_KEYGEN_PCT -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand Down Expand Up @@ -52,6 +53,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_zeroize_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -64,6 +66,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_native_capability_config_1.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -76,6 +79,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_native_capability_config_0.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -88,6 +92,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -march=armv8.4-a+sha3 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_native_capability_config_ID_AA64PFR1_EL1.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -100,6 +105,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -mavx2 -mbmi2 -mpopcnt -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_native_capability_config_CPUID_AVX2.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -112,6 +118,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/no_asm_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -124,6 +131,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_randombytes_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -136,6 +144,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_memcpy_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -148,6 +157,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_memset_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -160,6 +170,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-std=c11 -D_GNU_SOURCE -DMLK_CONFIG_FILE=\\\\\\\"../../test/custom_stdlib_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -172,6 +183,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -DMLKEM_GEN_MATRIX_NBLOCKS=1"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -184,6 +196,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -DMLKEM_GEN_MATRIX_NBLOCKS=2"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand All @@ -196,6 +209,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
compile_mode: native
cflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -DMLKEM_GEN_MATRIX_NBLOCKS=4"
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
func: true
kat: true
acvp: true
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ inputs:
cflags:
description: CFLAGS to pass to compilation
default: ""
ldflags:
description: LDFLAGS to pass to linking
default: ""
cross_prefix:
description: Binary prefix for cross compilation
default: ""
Expand Down Expand Up @@ -99,7 +102,7 @@ runs:
shell: ${{ env.SHELL }}
run: |
make clean
./scripts/tests all ${{ inputs.check_namespace == 'true' && '--check-namespace' || ''}} --exec-wrapper="${{ inputs.exec_wrapper }}" --cross-prefix="${{ inputs.cross_prefix }}" --cflags="${{ inputs.cflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.ACVP }} --${{ env.EXAMPLES }} --${{ env.STACK }} -v ${{ inputs.extra_args }}
./scripts/tests all ${{ inputs.check_namespace == 'true' && '--check-namespace' || ''}} --exec-wrapper="${{ inputs.exec_wrapper }}" --cross-prefix="${{ inputs.cross_prefix }}" --cflags="${{ inputs.cflags }}" --ldflags="${{ inputs.ldflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.ACVP }} --${{ env.EXAMPLES }} --${{ env.STACK }} -v ${{ inputs.extra_args }}
- name: Post ${{ env.MODE }} Tests
shell: ${{ env.SHELL }}
if: success() || failure()
Expand Down
10 changes: 10 additions & 0 deletions .github/actions/multi-functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ inputs:
cflags:
description: CFLAGS to pass to compilation
default: ""
ldflags:
description: LDFLAGS to pass to linking
default: ""
compile_mode:
description: all | native | cross-x86_64 | cross-aarch64 | cross-riscv64 | cross-riscv32
default: "native"
Expand Down Expand Up @@ -62,6 +65,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: ${{ inputs.cflags }}
ldflags: ${{ inputs.ldflags }}
opt: ${{ inputs.opt }}
func: ${{ inputs.func }}
kat: ${{ inputs.kat }}
Expand All @@ -80,6 +84,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: "${{ inputs.cflags }} -DMLK_FORCE_X86_64"
ldflags: ${{ inputs.ldflags }}
cross_prefix: x86_64-unknown-linux-gnu-
exec_wrapper: qemu-x86_64
opt: ${{ inputs.opt }}
Expand All @@ -100,6 +105,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: "${{ inputs.cflags }} -DMLK_FORCE_AARCH64"
ldflags: ${{ inputs.ldflags }}
cross_prefix: aarch64-unknown-linux-gnu-
exec_wrapper: qemu-aarch64
opt: ${{ inputs.opt }}
Expand All @@ -120,6 +126,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: "${{ inputs.cflags }} -DMLK_FORCE_PPC64LE"
ldflags: ${{ inputs.ldflags }}
cross_prefix: powerpc64le-unknown-linux-gnu-
exec_wrapper: qemu-ppc64le
opt: ${{ inputs.opt }}
Expand All @@ -140,6 +147,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: "${{ inputs.cflags }} -static -DMLK_FORCE_AARCH64_EB"
ldflags: "${{ inputs.ldflags }} -static"
cross_prefix: aarch64_be-none-linux-gnu-
exec_wrapper: qemu-aarch64_be
opt: ${{ inputs.opt }}
Expand All @@ -160,6 +168,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: "${{ inputs.cflags }} -DMLK_FORCE_RISCV64"
ldflags: ${{ inputs.ldflags }}
cross_prefix: riscv64-unknown-linux-gnu-
exec_wrapper: qemu-riscv64
opt: ${{ inputs.opt }}
Expand All @@ -180,6 +189,7 @@ runs:
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: "${{ inputs.cflags }} -DMLK_FORCE_RISCV32"
ldflags: ${{ inputs.ldflags }}
cross_prefix: riscv32-unknown-linux-gnu-
exec_wrapper: qemu-riscv32
opt: ${{ inputs.opt }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,11 @@ jobs:
needs: [ base, nix ]
uses: ./.github/workflows/slothy.yml
secrets: inherit
baremetal:
name: Baremetal
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/baremetal.yml
secrets: inherit
39 changes: 39 additions & 0 deletions .github/workflows/baremetal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) The mldsa-native project authors
# Copyright (c) The mlkem-native project authors
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT

name: Baremetal
permissions:
contents: read
on:
workflow_call:
workflow_dispatch:

jobs:
baremetal_tests:
name: Baremetal tests (${{ matrix.target.name }})
strategy:
fail-fast: false
matrix:
target:
- runner: ubuntu-latest
name: 'M55-AN547'
makefile: test/baremetal/platform/m55-an547/platform.mk
nix-shell: arm-embedded
runs-on: ${{ matrix.target.runner }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: baremetal build + test
uses: ./.github/actions/functest
env:
EXTRA_MAKEFILE: ${{ matrix.target.makefile }}
with:
nix-shell: ${{ matrix.target.nix-shell }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
opt: no_opt
func: true
kat: true
acvp: true
examples: false
stack: false
extra_args: --no-auto
18 changes: 16 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,31 @@ jobs:
bench_pmu: PMU
archflags: -mcpu=cortex-a72 -DMLK_SYS_AARCH64_SLOW_BARREL_SHIFTER
cflags: "-flto -DMLK_FORCE_AARCH64"
ldflags: "-flto"
bench_extra_args: ""
nix_shell: ci-bench
- system: rpi5
name: Arm Cortex-A76 (Raspberry Pi 5) benchmarks
bench_pmu: PERF
archflags: "-mcpu=cortex-a76 -march=armv8.2-a"
cflags: "-flto -DMLK_FORCE_AARCH64"
ldflags: "-flto"
bench_extra_args: ""
nix_shell: ci-bench
- system: a55
name: Arm Cortex-A55 (Snapdragon 888) benchmarks
bench_pmu: PERF
archflags: "-mcpu=cortex-a55 -march=armv8.2-a"
cflags: "-flto -static -DMLK_FORCE_AARCH64 -DMLK_CONFIG_FIPS202_BACKEND_FILE=\\\\\\\"fips202/native/aarch64/x1_scalar.h\\\\\\\""
cflags: "-flto -DMLK_FORCE_AARCH64 -DMLK_CONFIG_FIPS202_BACKEND_FILE=\\\\\\\"fips202/native/aarch64/x1_scalar.h\\\\\\\""
ldflags: "-flto -static"
bench_extra_args: -w exec-on-a55
nix_shell: ci-bench
- system: bpi
name: SpacemiT K1 8 (Banana Pi F3) benchmarks
bench_pmu: PERF
archflags: "-march=rv64imafdcv_zicsr_zifencei"
cflags: "-static"
cflags: ""
ldflags: "-static"
bench_extra_args: -w exec-on-bpi
cross_prefix: riscv64-unknown-linux-gnu-
nix_shell: ci-cross-riscv64
Expand All @@ -61,6 +65,7 @@ jobs:
bench_pmu: MAC
archflags: "-mcpu=apple-m1 -march=armv8.4-a+sha3"
cflags: "-flto"
ldflags: "-flto"
bench_extra_args: "-r"
nix_shell: ci-bench
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
Expand All @@ -72,6 +77,7 @@ jobs:
name: ${{ matrix.target.name }}
cflags: ${{ matrix.target.cflags }}
archflags: ${{ matrix.target.archflags }}
ldflags: ${{ matrix.target.ldflags }}
perf: ${{ matrix.target.bench_pmu }}
store_results: ${{ github.repository_owner == 'pq-code-package' && github.ref == 'refs/heads/main' }}
bench_extra_args: ${{ matrix.target.bench_extra_args }}
Expand All @@ -94,42 +100,49 @@ jobs:
ec2_ami: ubuntu-latest (aarch64)
archflags: -mcpu=cortex-a76 -march=armv8.2-a
cflags: "-flto -DMLK_FORCE_AARCH64"
ldflags: "-flto"
perf: PERF
- name: Graviton3
ec2_instance_type: c7g.medium
ec2_ami: ubuntu-latest (aarch64)
archflags: -march=armv8.4-a+sha3
cflags: "-flto -DMLK_FORCE_AARCH64"
ldflags: "-flto"
perf: PERF
- name: Graviton4
ec2_instance_type: c8g.medium
ec2_ami: ubuntu-latest (aarch64)
archflags: -march=armv9-a+sha3
cflags: "-flto -DMLK_FORCE_AARCH64"
ldflags: "-flto"
perf: PERF
- name: AMD EPYC 4th gen (c7a)
ec2_instance_type: c7a.medium
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -march=znver4
cflags: "-flto -DMLK_FORCE_X86_64"
ldflags: "-flto"
perf: PMU
- name: Intel Xeon 4th gen (c7i)
ec2_instance_type: c7i.metal-24xl
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -march=sapphirerapids
cflags: "-flto -DMLK_FORCE_X86_64"
ldflags: "-flto"
perf: PMU
- name: AMD EPYC 3rd gen (c6a)
ec2_instance_type: c6a.large
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -march=znver3
cflags: "-flto -DMLK_FORCE_X86_64"
ldflags: "-flto"
perf: PMU
- name: Intel Xeon 3rd gen (c6i)
ec2_instance_type: c6i.large
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -march=icelake-server
cflags: "-flto -DMLK_FORCE_X86_64"
ldflags: "-flto"
perf: PMU
uses: ./.github/workflows/bench_ec2_reusable.yml
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
Expand All @@ -138,6 +151,7 @@ jobs:
ec2_ami: ${{ matrix.target.ec2_ami }}
archflags: ${{ matrix.target.archflags }}
cflags: ${{ matrix.target.cflags }}
ldflags: ${{ matrix.target.ldflags }}
opt: "all"
store_results: ${{ github.repository_owner == 'pq-code-package' && github.ref == 'refs/heads/main' }} # Only store optimized results
name: ${{ matrix.target.name }}
Expand Down
Loading
Loading