bash script and make recipe for ease of running KATs

Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
This commit is contained in:
Anjan Roy
2022-11-01 12:50:54 +04:00
parent b2c12b1f4d
commit 0824229b6f
2 changed files with 15 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ OPTFLAGS = -O3 -march=native
IFLAGS = -I ./include
DEP_IFLAGS = -I ./sha3/include
all: testing
all: testing test_kat
wrapper/libkyber_kem.so: wrapper/kyber_kem.cpp include/*.hpp sha3/include/*.hpp
$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(IFLAGS) $(DEP_IFLAGS) -fPIC --shared $< -o $@
@@ -17,6 +17,9 @@ test/a.out: test/main.cpp include/*.hpp sha3/include/*.hpp
testing: test/a.out
./$<
test_kat:
bash test_kat.sh
clean:
find . -name '*.out' -o -name '*.o' -o -name '*.so' -o -name '*.gch' | xargs rm -rf

11
test_kat.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
# 1. Make shared library object
make lib
# 2. Run test cases
pushd wrapper/python
cp ../../kats/kyber{512,768,1024}.kat .
python3 -m pytest -v
rm kyber{512,768,1024}.kat
popd