From e914d186960e400a7491ae7bcde51ce67ea856a4 Mon Sep 17 00:00:00 2001 From: Douglas Stebila Date: Wed, 6 Feb 2019 18:37:50 -0500 Subject: [PATCH] Create nmake file for building on Windows and fix compilation error --- .gitignore | 4 ++++ crypto_kem/kyber768/clean/Makefile.Microsoft_nmake | 14 ++++++++++++++ crypto_kem/kyber768/clean/indcpa.c | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 crypto_kem/kyber768/clean/Makefile.Microsoft_nmake diff --git a/.gitignore b/.gitignore index e0b99a16..3794b9c0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ bin/ *.a *.so *~ + +# Object and library files on Windows +*.lib +*.obj diff --git a/crypto_kem/kyber768/clean/Makefile.Microsoft_nmake b/crypto_kem/kyber768/clean/Makefile.Microsoft_nmake new file mode 100644 index 00000000..c7fa6449 --- /dev/null +++ b/crypto_kem/kyber768/clean/Makefile.Microsoft_nmake @@ -0,0 +1,14 @@ +LIB=libkyber768_clean.lib + +OBJECTS=cbd.obj indcpa.obj kem.obj kex.obj ntt.obj poly.obj polyvec.obj precomp.obj reduce.obj verify.obj + +CFLAGS=/I ..\..\..\common /W1 /WX # FIXME: ideally would use /W4 instead of /W1, but too many failures in Kyber right now + +all: $(LIB) + +$(LIB): $(OBJECTS) + LIB.EXE /OUT:$@ $** + +clean: + DEL $(OBJECTS) + DEL $(LIB) diff --git a/crypto_kem/kyber768/clean/indcpa.c b/crypto_kem/kyber768/clean/indcpa.c index 528851c7..210ad1e9 100644 --- a/crypto_kem/kyber768/clean/indcpa.c +++ b/crypto_kem/kyber768/clean/indcpa.c @@ -133,7 +133,7 @@ void PQCLEAN_KYBER768_gen_matrix(polyvec *a, const unsigned char *seed, uint16_t val; unsigned int nblocks; const unsigned int maxnblocks = 4; - uint8_t buf[SHAKE128_RATE * maxnblocks]; + uint8_t buf[SHAKE128_RATE * /* maxnblocks = */ 4]; int i, j; uint64_t state[25]; // SHAKE state unsigned char extseed[KYBER_SYMBYTES + 2];