Skip to content

Commit 6bba531

Browse files
committed
Add rng_fail test Windows support (C backend only)
mlkem-native currently has no rng_fail test coverage on Windows. This commit enabling rng_fail tests against the portable C backend. Signed-off-by: willieyz <willie.zhao@chelpis.com>
1 parent 49c4d01 commit 6bba531

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

Makefile.Microsoft_nmake

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,30 @@ gen_KAT1024: $(OBJ_FILES_1024) $(MLKEM1024_BUILD_DIR)\test\gen_KAT.obj $(BUILD_D
125125
@if NOT EXIST $(MLKEM1024_BUILD_DIR)\bin mkdir $(MLKEM1024_BUILD_DIR)\bin
126126
$(CC) $(CFLAGS) /D MLK_CONFIG_PARAMETER_SET=1024 /Fe$(MLKEM1024_BUILD_DIR)\bin\gen_KAT1024 $** /link
127127

128+
# compile RNG fail test for mlkem512
129+
test_rng_fail512: $(OBJ_FILES_512) $(MLKEM512_BUILD_DIR)\test\test_rng_fail.obj
130+
@if NOT EXIST $(MLKEM512_BUILD_DIR)\bin mkdir $(MLKEM512_BUILD_DIR)\bin
131+
$(CC) $(CFLAGS) /D MLK_CONFIG_PARAMETER_SET=512 /Fe$(MLKEM512_BUILD_DIR)\bin\test_rng_fail512 $** /link
132+
133+
# compile RNG fail test for mlkem768
134+
test_rng_fail768: $(OBJ_FILES_768) $(MLKEM768_BUILD_DIR)\test\test_rng_fail.obj
135+
@if NOT EXIST $(MLKEM768_BUILD_DIR)\bin mkdir $(MLKEM768_BUILD_DIR)\bin
136+
$(CC) $(CFLAGS) /D MLK_CONFIG_PARAMETER_SET=768 /Fe$(MLKEM768_BUILD_DIR)\bin\test_rng_fail768 $** /link
137+
138+
# compile RNG fail test for mlkem1024
139+
test_rng_fail1024: $(OBJ_FILES_1024) $(MLKEM1024_BUILD_DIR)\test\test_rng_fail.obj
140+
@if NOT EXIST $(MLKEM1024_BUILD_DIR)\bin mkdir $(MLKEM1024_BUILD_DIR)\bin
141+
$(CC) $(CFLAGS) /D MLK_CONFIG_PARAMETER_SET=1024 /Fe$(MLKEM1024_BUILD_DIR)\bin\test_rng_fail1024 $** /link
142+
128143
acvp: acvp_mlkem512 acvp_mlkem768 acvp_mlkem1024
129144

130145
gen_KAT: gen_KAT512 gen_KAT768 gen_KAT1024
131146

147+
run_rng_fail: test_rng_fail512 test_rng_fail768 test_rng_fail1024
148+
$(MLKEM512_BUILD_DIR)\bin\test_rng_fail512.exe
149+
$(MLKEM768_BUILD_DIR)\bin\test_rng_fail768.exe
150+
$(MLKEM1024_BUILD_DIR)\bin\test_rng_fail1024.exe
151+
132152
run_kat: gen_KAT
133153
python test/src/kat_client.py
134154

@@ -140,7 +160,7 @@ run_func: test_mlkem512 test_mlkem768 test_mlkem1024
140160
$(MLKEM768_BUILD_DIR)\bin\test_mlkem768.exe
141161
$(MLKEM1024_BUILD_DIR)\bin\test_mlkem1024.exe
142162

143-
test: run_func run_acvp run_kat
163+
test: run_func run_acvp run_kat run_rng_fail
144164
@echo Everything checks fine!
145165

146166
quickcheck: test

0 commit comments

Comments
 (0)