noloader / cryptopp-cmake

CMake files for Crypto++ project
BSD 3-Clause "New" or "Revised" License
92 stars 68 forks source link

Fix compilation error when toolchain supports sse3, sse4 #61

Closed lzy1g1225 closed 4 years ago

lzy1g1225 commented 4 years ago

Fix the compilation error: "error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'RotateLeft32' that is compiled without support for 'ssse3' ... "

noloader commented 4 years ago

It sounds like you should be using cryptopp-cmake-8.2.0.

cryptopp-autotools and cryptopp-cmake follow Crypto++ releases. They are also sync'd with Crypto++ master. Crypto++ master removed the 64-bit SIMD implementations.

The SIMD files for 64-bit block ciphers were removed because they failed to produce correct results in some modes. Also see Issue 945.

lzy1g1225 commented 4 years ago

Thanks, I don't know about cryptopp, but I was actually using both cryptopp-master and cryptopp-cmake-master. Switch both repo to tag 8.2 works now.

noloader commented 4 years ago

@lzy1g1225,

Thanks, I don't know about cryptopp, but I was actually using both cryptopp-master and cryptopp-cmake-master.

Something does not sound correct for you here.

Here's what my Master looks like. Notice there is no simeck_simd.cpp, simon64_simd.cpp or speck64_sid.cpp.

cryptopp$ git branch
* master
cryptopp$ ls *_simd.cpp
aria_simd.cpp     crc_simd.cpp     neon_simd.cpp      simon128_simd.cpp
blake2b_simd.cpp  gcm_simd.cpp     ppc_simd.cpp       sm4_simd.cpp
blake2s_simd.cpp  gf2n_simd.cpp    rijndael_simd.cpp  speck128_simd.cpp
chacha_simd.cpp   keccak_simd.cpp  shacal2_simd.cpp   sse_simd.cpp
cham_simd.cpp     lea_simd.cpp     sha_simd.cpp

And here is the result of cryptopp-cmake master. Again, no simeck_simd.cpp, simon64_simd.cpp or speck64_sid.cpp.

cryptopp-cmake$ git branch
* master
cryptopp-cmake$ grep -E 'simeck_simd|simon64_simd|speck64_simd' CMakeLists.txt 
cryptopp-cmake$

Here is the cryptopp commit that removed them: Commit dd7598e638bb. Here is the cryptopp-cmake commit that removed them: Commit 1b1e88f58adf. Both commits are dated July 7, 2020.

On the other hand, cryptopp-8.2.0 and cryptopp-cmake-8.2.0 will both have the files since they were recently removed from Master. If you have simeck_simd.cpp, simon64_simd.cpp or speck64_sid.cpp, then you are not using Master.

lzy1g1225 commented 4 years ago

Looks like my local copy are not same as the remote. Sorry for that!