Skip to content

Commit

Permalink
test:
Browse files Browse the repository at this point in the history
  • Loading branch information
tfaoliveira-sb committed Jul 26, 2024
1 parent 58f1cad commit 97d1aae
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
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


2 changes: 1 addition & 1 deletion code/jasmin/mlkem_avx2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ run-tests-polyvec: compile-tests-polyvec
for i in $(TESTS_POLYVEC); do ./$$i; done

run-tests: compile-tests
for i in $(TESTS); do ./$$i; done
@for i in $(TESTS); do ./$$i; done

# --

Expand Down
2 changes: 1 addition & 1 deletion code/jasmin/mlkem_avx2/example/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#define JADE_KEM_mlkem_mlkem768_amd64_avx2_ALGNAME "mlkem768"
#define JADE_KEM_mlkem_mlkem768_amd64_avx2_ARCH "amd64"
#define JADE_KEM_mlkem_mlkem768_amd64_avx2_IMPL "ref"
#define JADE_KEM_mlkem_mlkem768_amd64_avx2_IMPL "avx2"

int jade_kem_mlkem_mlkem768_amd64_avx2_keypair_derand(
uint8_t *public_key,
Expand Down
2 changes: 1 addition & 1 deletion code/jasmin/mlkem_avx2/test/test_kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ int main(void)
{ printf("OK: kem_dec_success\n"); }

if(test_ok_kem_dec_failure == 1)
{ printf("OK: kem_dec_failure (corrupting byte)\n"); }
{ printf("OK: kem_dec_failure (it is the corrupting byte test)\n"); }

return 0;
}
2 changes: 1 addition & 1 deletion code/jasmin/mlkem_ref/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ run-tests-polyvec: compile-tests-polyvec
for i in $(TESTS_POLYVEC); do ./$$i; done

run-tests: compile-tests
for i in $(TESTS); do ./$$i; done
@for i in $(TESTS); do ./$$i; done

# --

Expand Down
2 changes: 1 addition & 1 deletion code/jasmin/mlkem_ref/test/test_kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ int main(void)
{ printf("OK: kem_dec_success\n"); }

if(test_ok_kem_dec_failure == 1)
{ printf("OK: kem_dec_failure (corrupting byte)\n"); }
{ printf("OK: kem_dec_failure (it is the corrupting byte test)\n"); }

return 0;
}

0 comments on commit 97d1aae

Please sign in to comment.