intel / pailliercryptolib

Intel Paillier Cryptosystem Library is an open-source library which provides accelerated performance of a partial homomorphic encryption (HE), named Paillier cryptosystem, by utilizing Intel® IPP-Crypto on AVX512IFMA instructions. Intel Paillier Cryptosystem Library is certified for ISO compliance.
Apache License 2.0
73 stars 18 forks source link

Build error using gcc/g++12 #27

Closed xhuan28 closed 2 years ago

xhuan28 commented 2 years ago

I tried to build IPCL with gcc-toolset-12 and build failed with the following error message. However, there is no build failure with gcc8.5.

In file included from pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto-build/c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c:32: In function ‘PadBlock’, inlined from ‘n0_ippsAES_CMACGetTag’ at pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto-build/c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c:82:10: pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto/sources/ippcp/pcptool.h:94:12: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 94 | d[k] = paddingByte; | ~^~~~~ pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto-build/c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c: In function ‘n0_ippsAES_CMACGetTag’: pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto-build/c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c:71:13: note: at offset 16 into destination object ‘locBuffer’ of size 16 71 | Ipp8u locBuffer[MBS_RIJ128]; | ^~~~~ In function ‘PadBlock’, inlined from ‘n0_ippsAES_CMACGetTag’ at pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto-build/c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c:82:10: pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto/sources/ippcp/pcptool.h:94:12: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 94 | d[k] = paddingByte; | ~^~~~~ pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto-build/c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c: In function ‘n0_ippsAES_CMACGetTag’: pailliercryptolib/build/ext_ipp-crypto/src/ext_ipp-crypto-build/c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c:71:13: note: at offset [32, 48] into destination object ‘locBuffer’ of size 16 71 | Ipp8u locBuffer[MBS_RIJ128]; | ^~~~~ cc1: all warnings being treated as errors make[5]: [sources/ippcp/CMakeFiles/ippcp_s_n0.dir/build.make:1602: sources/ippcp/CMakeFiles/ippcp_s_n0.dir///c_sources/n0/c_intel64/n0_pcpaes_cmacgettag.c.o] Error 1 make[4]: [CMakeFiles/Makefile2:426: sources/ippcp/CMakeFiles/ippcp_s_n0.dir/all] Error 2 make[3]: [Makefile:136: all] Error 2 make[2]: [CMakeFiles/ext_ipp-crypto.dir/build.make:86: ext_ipp-crypto/src/ext_ipp-crypto-stamp/ext_ipp-crypto-build] Error 2 make[1]: [CMakeFiles/Makefile2:140: CMakeFiles/ext_ipp-crypto.dir/all] Error 2 make: [Makefile:136: all] Error 2

skmono commented 2 years ago

Hi this is a known bug introduced in IPP-Crypto with gcc-11 and higher, due to the stringop-overflow false positive error. We applied a emergency patch 250ab34ced7bd8aab7f41e57e3f2a52dbc51c1b4, where it adds -Wno-stringop-overflow compiler flag when using GNU compilers. It can be found in the upstream branches as well as v1.1.4 release tag with the updates.