pq-crystals/kyber

Error when running `cd kyber/ref && make`

zhangl64 opened this issue · 8 comments

Error message:

rng.c:10:10: fatal error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
make: *** [PQCgenKAT_kem] Error 1

Thanks.

Thanks for the suggests, I am working on Mac, and I installed openssl via home-brew. I did the following:

echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

But I still hit the same error...Any suggestion on this? Many thanks.

Our Makefile didn't use LDFLAGS and instead of CPPFLAGS you have to add the openssl directory to CFLAGS. So please update your repository and try with the following commands:

export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CFLAGS="-I/usr/local/opt/openssl@1.1/include"

@gregorseiler , thanks for your kind help, I pulled the latest changes and updated my .bash_profile with

export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CFLAGS="-I/usr/local/opt/openssl@1.1/include"

However, I hit the same error at rng.c:

cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=2 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c randombytes.c test_kyber.c -o test_kyber512-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=3 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c randombytes.c test_kyber.c -o test_kyber768-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=4 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c randombytes.c test_kyber.c -o test_kyber1024-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=2 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c randombytes.c fips202.c kex.c test_kex.c -o test_kex512-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=3 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c randombytes.c fips202.c kex.c test_kex.c -o test_kex768-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=4 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c randombytes.c fips202.c kex.c test_kex.c -o test_kex1024-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=2 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c test_vectors.c -o test_vectors512-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=3 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c test_vectors.c -o test_vectors768-90s
cc -I/usr/local/opt/openssl@1.1/include -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls -Wshadow -Wpointer-arith -O3 -D KYBER_90S -DKYBER_K=4 kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c sha256.c sha512.c aes256ctr.c symmetric-aes.c test_vectors.c -o test_vectors1024-90s
cc -Wno-unused-result -O3 -o PQCgenKAT_kem kem.c indcpa.c polyvec.c poly.c reduce.c ntt.c cbd.c verify.c fips202.c symmetric-shake.c -I. rng.c PQCgenKAT_kem.c -L/usr/local/opt/openssl@1.1/lib -lcrypto
rng.c:10:10: fatal error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
make: *** [PQCgenKAT_kem] Error 1

Thanks.

Ah, I forgot that we have separate flags for PQCgenKAT_kem. Please try

export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export NISTFLAGS="-I/usr/local/opt/openssl@1.1/include"

Thanks a million @gregorseiler , problem solved!

please tell how to resolve this issue in windows 10

We currently require a GNU build environment. I would recommend to use the Kyber implementation in https://github.com/PQClean/PQClean