Skip to content

Commit f4f8d99

Browse files
authored
Merge pull request #9 from pq-code-package/ci-acvp
CI: Add ACVP tests in CI
2 parents 6079933 + aec746a commit f4f8d99

File tree

10 files changed

+339
-347
lines changed

10 files changed

+339
-347
lines changed

.github/workflows/all.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ on:
1313
branches: ["main"]
1414
types: [ "opened", "synchronize" ]
1515
jobs:
16+
base:
17+
name: Base
18+
permissions:
19+
contents: 'read'
20+
id-token: 'write'
21+
uses: ./.github/workflows/base.yml
22+
secrets: inherit
1623
nix:
1724
name: Nix
1825
permissions:
@@ -26,7 +33,6 @@ jobs:
2633
permissions:
2734
contents: 'read'
2835
id-token: 'write'
29-
needs: [ nix ]
36+
needs: [ base, nix ]
3037
uses: ./.github/workflows/cbmc.yml
3138
secrets: inherit
32-

.github/workflows/base.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) The mlkem-native project authors
2+
# Copyright (c) The slhdsa-c project authors
3+
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
4+
5+
name: Base
6+
permissions:
7+
contents: read
8+
on:
9+
workflow_call:
10+
workflow_dispatch:
11+
12+
jobs:
13+
quickcheck:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
external:
18+
- ${{ github.repository_owner != 'pq-code-package' }}
19+
target:
20+
- runner: pqcp-arm64
21+
name: 'aarch64'
22+
- runner: ubuntu-latest
23+
name: 'x86_64'
24+
- runner: macos-latest
25+
name: 'macos (aarch64)'
26+
- runner: macos-13
27+
name: 'macos (x86_64)'
28+
acvp-version: [v1.1.0.40, v1.1.0.39]
29+
exclude:
30+
- {external: true,
31+
target: {
32+
runner: pqcp-arm64,
33+
name: 'aarch64'
34+
}}
35+
name: Quickcheck (${{ matrix.target.name }}, ACVP ${{ matrix.acvp-version }})
36+
runs-on: ${{ matrix.target.runner }}
37+
steps:
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
- name: Run ACVP test
40+
run: |
41+
make
42+
python3 test/acvp_client.py --version ${{ matrix.acvp-version }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ modules.order
6363
Module.symvers
6464
Mkfile.old
6565
dkms.conf
66+
# Downloaded ACVP test data
67+
test/.acvp-data/

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,8 @@ $(XTEST): $(OBJS)
3434
%.o: %.[cS]
3535
$(CC) $(CFLAGS) -c $^ -o $@
3636

37-
# without gnu parallel: bash test/acvp_cases.sh | tee test.log
38-
test: $(XTEST) test/acvp_cases.sh
39-
cat test/acvp_cases.sh | parallel --pipe bash | tee test.log
40-
@echo "=== test summary ==="
41-
@echo "PASS:" `grep -c PASS test.log`
42-
@echo "SKIP:" `grep -c SKIP test.log`
43-
@echo "FAIL:" `grep -c FAIL test.log`
44-
45-
test/acvp_cases.sh:
46-
cd test && $(MAKE) acvp_cases.sh
37+
test: $(XTEST)
38+
python3 test/acvp_client.py
4739

4840
clean:
4941
$(RM) -rf $(XTEST) $(OBJS) *.rsp *.req *.log

cbmc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) The mlkem-native project authors
3-
* Copyright (c) The slhdsa-native project authors
3+
* Copyright (c) The slhdsa-c project authors
44
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
55
*/
66

test/ACVP-Server

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,13 @@ $(XCOUNT): $(OBJS) xcount.c my_dbg.c
2121
%.o: %.[cS]
2222
$(CC) $(CFLAGS) -c $^ -o $@
2323

24-
acvp_cases.sh: ACVP-Server/gen-val/json-files
25-
python3 test_slhdsa.py > $@
26-
27-
new_param.csv: $(XCOUNT) test_param.py new_param.txt acvp_cases.sh
24+
new_param.csv: $(XCOUNT) test_param.py new_param.txt
2825
echo "alg_id, pk, sk, sig, keygen, sign, vfy_ok, vfy_fail"> $@
2926
./$(XCOUNT) | tee /dev/tty | sort >> $@
3027
python3 test_param.py | parallel | tee /dev/tty | sort >> $@
3128

32-
ACVP-Server/gen-val/json-files:
33-
git submodule update --init ACVP-Server
34-
3529
clean:
3630
$(RM) -rf $(XCOUNT) $(OBJS) *.log
3731
$(RM) -f *.pyc *.cprof */*.pyc *.rsp *.log
38-
$(RM) -f acvp_cases.sh
3932
$(RM) -rf __pycache__ */__pycache__
4033

0 commit comments

Comments
 (0)