-
Notifications
You must be signed in to change notification settings - Fork 771
pq-crypto/kyber_90s_r2/ntt.c fails to build with gcc 11 with -Werror #2989
Copy link
Copy link
Closed
Labels
Description
Security issue notifications
minimal
Problem:
pq-crypto/kyber_90s_r2/ntt.h declares the number-theoretic transform clean functions as:
s2n-tls/pq-crypto/kyber_90s_r2/ntt.h
Lines 9 to 10 in 7a7f7fc
| void PQCLEAN_KYBER51290S_CLEAN_ntt(int16_t *poly); | |
| void PQCLEAN_KYBER51290S_CLEAN_invntt(int16_t *poly); |
pq-crypto/kyber_90s_r2/ntt.c implements them as:s2n-tls/pq-crypto/kyber_90s_r2/ntt.c
Line 92 in 7a7f7fc
| void PQCLEAN_KYBER51290S_CLEAN_ntt(int16_t poly[256]) { |
s2n-tls/pq-crypto/kyber_90s_r2/ntt.c
Line 116 in 7a7f7fc
| void PQCLEAN_KYBER51290S_CLEAN_invntt(int16_t poly[256]) { |
This causes the following build error (with -Werror enabled)
/home/maarten/.conan/data/s2n/1.0.11/_/_/build/ea52c257f3ec393174a518e0be296686d3870cfe/source_subfolder/pq-crypto/kyber_90s_r2/ntt.c:92:44: error: argument 1 of type ‘int16_t[256]’ {aka ‘short int[256]’} with mismatched bound [-Werror=array-parameter=]
92 | void PQCLEAN_KYBER51290S_CLEAN_ntt(int16_t poly[256]) {
| ~~~~~~~~^~~~~~~~~
In file included from /home/maarten/.conan/data/s2n/1.0.11/_/_/build/ea52c257f3ec393174a518e0be296686d3870cfe/source_subfolder/pq-crypto/kyber_90s_r2/ntt.c:1:
/home/maarten/.conan/data/s2n/1.0.11/_/_/build/ea52c257f3ec393174a518e0be296686d3870cfe/source_subfolder/pq-crypto/kyber_90s_r2/ntt.h:9:45: note: previously declared as ‘int16_t *’ {aka ‘short int *’}
9 | void PQCLEAN_KYBER51290S_CLEAN_ntt(int16_t *poly);
| ~~~~~~~~~^~~~
/home/maarten/.conan/data/s2n/1.0.11/_/_/build/ea52c257f3ec393174a518e0be296686d3870cfe/source_subfolder/pq-crypto/kyber_90s_r2/ntt.c:116:47: error: argument 1 of type ‘int16_t[256]’ {aka ‘short int[256]’} with mismatched bound [-Werror=array-parameter=]
116 | void PQCLEAN_KYBER51290S_CLEAN_invntt(int16_t poly[256]) {
| ~~~~~~~~^~~~~~~~~
In file included from /home/maarten/.conan/data/s2n/1.0.11/_/_/build/ea52c257f3ec393174a518e0be296686d3870cfe/source_subfolder/pq-crypto/kyber_90s_r2/ntt.c:1:
/home/maarten/.conan/data/s2n/1.0.11/_/_/build/ea52c257f3ec393174a518e0be296686d3870cfe/source_subfolder/pq-crypto/kyber_90s_r2/ntt.h:10:48: note: previously declared as ‘int16_t *’ {aka ‘short int *’}
10 | void PQCLEAN_KYBER51290S_CLEAN_invntt(int16_t *poly);
|
Solution:
Modify the declarations in pq-crypto/kyber_90s_r2/ntt.h to include the size of the polynomal.
Reactions are currently unavailable