Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: mlkem #47

Merged
merged 14 commits into from
Jul 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v3
- run: nix-shell --arg full false --run "echo Dependencies OK…"
- run: nix-shell --arg full false --run "make -C code/jasmin/mlkem_${{matrix.dir}}/ ct"
- run: nix-shell --arg full false --run "make -C code/jasmin/mlkem_${{matrix.dir}}/ check-constant-time"
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Tests"
on:
pull_request:
push:

jobs:
tests:
name: tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dir: [ 'ref', 'avx2' ]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v3
- run: nix-shell --arg full false --run "echo Dependencies OK…"
- run: nix-shell --arg full false --run "make -C code/jasmin/mlkem_${{matrix.dir}}/ run-tests"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.o
28 changes: 25 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,40 @@ ECCONF := config/tests.config
CHECKS ?= mlkem

# --------------------------------------------------------------------
.PHONY: default check checkec jasmin clean_eco
.PHONY: default check checkec jasmin clean_eco test bench

default: check

check: jasmin checkec

jasmin:
make -C code/jasmin/mlkem_ref/extraction
make -C code/jasmin/mlkem_avx2/extraction
$(MAKE) -C code/jasmin/mlkem_ref/extraction
$(MAKE) -C code/jasmin/mlkem_avx2/extraction

checkec:
easycrypt runtest $(ECCONF) $(CHECKS)

clean_eco:
find proof -name '*.eco' -exec rm '{}' ';'

test:
$(MAKE) -C code/jasmin/mlkem_ref/ -j$(nproc) compile-tests
$(MAKE) -C code/jasmin/mlkem_avx2/ -j$(nproc) compile-tests
@echo "\n\n### Testing the reference implementation"
$(MAKE) -C code/jasmin/mlkem_ref/ run-tests
@echo "\n\n### Testing the avx2 implementation"
$(MAKE) -C code/jasmin/mlkem_avx2/ run-tests

bench:
$(MAKE) -C code/jasmin/mlkem_ref/ -j$(nproc) compile-speed
$(MAKE) -C code/jasmin/mlkem_avx2/ -j$(nproc) compile-speed
@echo "\n\n### Benchmarking the reference implementation"
$(MAKE) -C code/jasmin/mlkem_ref/ run-speed
@echo "\n\n### Benchmarking the avx2 implementation"
$(MAKE) -C code/jasmin/mlkem_avx2/ run-speed

example:
$(MAKE) -C code/jasmin/mlkem_ref/example
$(MAKE) -C code/jasmin/mlkem_avx2/example


7 changes: 4 additions & 3 deletions code/Makefile.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- Makefile -*-

# --------------------------------------------------------------------
current_dir := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_DIR := $(abspath $(CURRENT_DIR)/../)

# --------------------------------------------------------------------
JASMINC ?= $(current_dir)/../jasmin/compiler/jasminc
JAZZCT ?= $(current_dir)/../jasmin/compiler/jazzct
JASMINC ?= $(abspath $(PROJECT_DIR)/jasmin/compiler/jasminc)
JASMIN_CT ?= $(abspath $(PROJECT_DIR)/jasmin/compiler/jasmin-ct)
36 changes: 36 additions & 0 deletions code/jasmin/mlkem_avx2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
jfips202.s
jindcpa.s
jkem.s
jpoly.s
jpolyvec.s
jspeed.s
test/test_fips202
test/test_indcpa
test/test_kem
test/test_poly_add2
test/test_poly_basemul
test/test_poly_compress
test/test_poly_csubq
test/test_poly_decompress
test/test_poly_frombytes
test/test_poly_frommont
test/test_poly_frommsg
test/test_poly_getnoise
test/test_poly_invntt
test/test_poly_ntt
test/test_poly_reduce
test/test_poly_sub
test/test_poly_tobytes
test/test_poly_tomsg
test/test_polyvec_add2
test/test_polyvec_compress
test/test_polyvec_csubq
test/test_polyvec_decompress
test/test_polyvec_frombytes
test/test_polyvec_invntt
test/test_polyvec_ntt
test/test_polyvec_pointwise_acc
test/test_polyvec_reduce
test/test_polyvec_tobytes
test/speed_indcpa
test/speed_mlkem
Loading