pq-crystals / dilithium

Other
391 stars 144 forks source link

Setting mode=3 causes hang #5

Closed joncmu closed 5 years ago

joncmu commented 5 years ago

If I set MODE to 3 in params.h test_dilithium doesn't seem to complete in both the ref and avx implementations.

gregorseiler commented 5 years ago

Hi joncmu,

since we can not include params.h in api.h, if you don't want to switch to a different mode via compiler flags (CFLAGS="-DMODE=3"), you have to change both files params.h and api.h. Otherwise the parameters are not set consistently. This is indeed not optimal. I have just committed a small modification to include sign.h instead of api.h in test_dilithium.c. So for test_dilithium it is now sufficient to just change params.h. But for PQCgenKAT_sign provided by NIST you still have to change both files. If one would include api.h in params.h, then it would be enough to change MODE in api.h but I don't want to do this now.

Hope this helps!

Regards, Gregor