Commit Graph

3437 Commits (e3d79bf98c3d068c4be602c544a0b2dec207d5a1)

Author SHA1 Message Date
Jeffrey Walton 3b1f6827f5
Clear Coverity issue CID 186338 2017-12-27 00:40:24 -05:00
Jeffrey Walton 09f9d76631
Fix "cast from 'struct sockaddr*' to 'struct sockaddr_in*' increases required alignment" on OS X 2017-12-26 17:57:26 -05:00
Jeffrey Walton 0aa2ebbbf3
Clear signed/unsigned warnings with GCC and -Wall -Wextra 2017-12-26 16:59:32 -05:00
Jeffrey Walton 4d9c91b425
Fix missing define for MSVC 2017-12-26 15:07:28 -05:00
Jeffrey Walton 4904d0fc8d
Fix unaligned load for _mm_loaddup_pd with GCC and UBsan 2017-12-26 14:55:10 -05:00
Jeffrey Walton 3fff9e85df
Fix unaligned load for _mm_loaddup_pd with GCC and UBsan 2017-12-26 12:41:04 -05:00
Jeffrey Walton ae445c0b0f
Clear signed/unsigned warnings with GCC and -Wall -Wextra 2017-12-26 11:48:11 -05:00
Jeffrey Walton 66da740ad3
Use M128_CAST and CONST_M128_CAST for Clang
Also see http://bugs.llvm.org/show_bug.cgi?id=20670
2017-12-26 11:20:18 -05:00
Jeffrey Walton 8e916e7bac
Use M128_CAST and CONST_M128_CAST for Clang
Also see http://bugs.llvm.org/show_bug.cgi?id=20670
2017-12-26 11:16:52 -05:00
Jeffrey Walton bee2598ecd
Add <emsa2.h> to dll.cpp 2017-12-26 10:53:11 -05:00
Jeffrey Walton b7133e7b3b
Fix Clang specialization and definition warnings (GH #300, GH #533)
Clang 3.8 and above generates lots of "'PKCS_DigestDecoration<SHA1>::decoration' required here, but no definition is available" warnings
2017-12-26 00:46:50 -05:00
Jeffrey Walton c0a8dab984
Fix failed self test under Clang (GH #533)
This may cause GH #300, "Clang 3.9 and missing member definitions for template classes" or GH #294, "Fix clang warnings about undefined variable templates in pkcspad.h" to resurface. Man I hope not...
2017-12-25 22:29:21 -05:00
Jeffrey Walton 4232cfd40b
Fix failed self test under Clang (GH #533)
This may cause GH #300, "Clang 3.9 and missing member definitions for template classes" or GH #294, "Fix clang warnings about undefined variable templates in pkcspad.h" to resurface. Man I hope not...
2017-12-25 22:27:53 -05:00
Jeffrey Walton b20a91f6b2
Update documentation 2017-12-24 21:07:18 -05:00
Jeffrey Walton 41da3fa7f1
Use ptrdiff_t cast in BlockTransformation (GH #549) 2017-12-17 09:07:12 -05:00
Jeffrey Walton d7a2e0e10c
Removed unneeded defines from ppc-simd.cpp
Whitespace check-in
2017-12-16 20:26:59 -05:00
Jeffrey Walton 19deccf3ba
Fix Clang 5.0 "runtime error: addition of unsigned offset to 0xXXXX overflowed to 0xYYYY" (GH #549) 2017-12-16 18:18:53 -05:00
Jeffrey Walton dc21de2483
Fix UBsan overflow finding
We were cating UBsan findings under Clang similar to "adv-simd.h:1138:26: runtime error: addition of unsigned offset to 0x000002d41410 overflowed to 0x000002d41400". The problem was CRYPTOPP_CONSTANT, which used an enum. The compiler is allowed to pick the underlying data type, and Clang was picking a signed type
2017-12-16 14:21:08 -05:00
zorun c3a85caf52 Build fixes (#547)
* GNUmakefile-cross: Fix install target

The install target was not working: missing mkdir before copying files,
wrong dynamic library copied, missing ldconf.

The fix is mostly taken from the install target from GNUmakefile.

* Makefile: call 'ln -sf' instead of 'ln -sf -sf'
2017-12-16 09:07:23 -05:00
Jeffrey Walton e56caf72ec
Fix unwanted Git mode change 2017-12-15 19:13:20 -05:00
Jeffrey Walton 7aa3377bbd Prepare for changes to support latest NDK liek r16 (GH #546) 2017-12-15 19:10:02 -05:00
Jeffrey Walton 93f6901119
Avoid including <arm_acle.h> on Android (GH #546)
It sure would be nice if everyone just followed the ACLE guidlines at http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf
2017-12-15 17:00:39 -05:00
Jeffrey Walton 43a34590a9
Add Altivec detection for PowerMac
We now need to detect Altivec/Power4. Formerly it did not matter so CPU_QueryAltivec simply returned false
2017-12-13 11:49:35 -05:00
Jeffrey Walton e1c9746b70
Fix Power8 compile under GCC 2017-12-12 10:52:57 -05:00
Jeffrey Walton 57e3ae309b
Update documentation
Remove typedefs
Whitespace check-in
2017-12-12 09:22:03 -05:00
Jeffrey Walton 2c79be7a54
Add CRYPTOPP_POWER5_AVAILABLE
Power4 lacks 'vector long long'
Rename datatypes such as 'uint8x16_p8' to 'uint8x16_p'. Originally the p8 suffix indicated use with Power8 in-core crypto. We are now using Altivec/Power4 for general vector operations.
2017-12-12 08:17:17 -05:00
Jeffrey Walton ca54d0c7da
Add CRYPTOPP_POWER5_AVAILABLE
Power4 lacks 'vector long long'
Rename datatypes such as 'uint8x16_p8' to 'uint8x16_p'. Originally the p8 suffix indicated use with Power8 in-core crypto. We are now using Altivec/Power4 for general vector operations.
2017-12-12 08:14:53 -05:00
Jeffrey Walton 15d637771f
Add CRYPTOPP_POWER5_AVAILABLE
Power4 lacks 'vector long long'
Rename datatypes such as 'uint8x16_p8' to 'uint8x16_p'. Originally the p8 suffix indicated use with Power8 in-core crypto. We are now using Altivec/Power4 for general vector operations.
2017-12-12 08:09:31 -05:00
Jeffrey Walton b7e636ac51
Rename ppc-crypto.h to ppc-simd.h 2017-12-12 07:15:59 -05:00
Jeffrey Walton 074c889210
Add NEON flags to rijndael-simd.cpp
AES does not have a NEON implementation. However, because it includes "adv-simd.h", it needs the compiler options so NEON types are available. Otherwise the compile fails.
We can't guard "adv-simd.h" and NEON on just AES because Simon and Speck use the templates in their NEON implementations.
2017-12-10 12:11:53 -05:00
Jeffrey Walton 195ac2c7c9
Refactor rijndael-simd.cpp and simon.simd.cpp to use adv-simd.h 2017-12-10 11:09:50 -05:00
Jeffrey Walton e90cc9a028
Update comments 2017-12-10 05:41:19 -05:00
Jeffrey Walton 8a5911e6eb
Refactor <cipher>_AdvancedProcessBlocks_<arch> into adv-simd.h
This also fixes the SPECK64 bug where CTR mode self tests fail. It was an odd failure because it only affected 64-bit SPECK. SIMON was fine and it used nearly the same code. We tracked it down through trial and error to the table based rotates.
2017-12-09 21:04:25 -05:00
Jeffrey Walton 3ff04f1bf0
Cleanup includes for CRC32 and CRC32C 2017-12-09 13:09:49 -05:00
Jeffrey Walton 65222dfe9e
Move location of CRYPTOPP_ARM_ACLE_AVAILABLE test in config.h
This should make it easier to detect when we need to include <arm_acle.h>
2017-12-09 13:07:50 -05:00
Jeffrey Walton 5856ab5a7e
Add Valgrind suppression file for Salsa20 and runtime's __memcmp_sse4_1 2017-12-08 17:46:44 -05:00
Jeffrey Walton e457ca26f7
Add SSE3 <pmmintrin.h> for SImon and Speck
Add additional comments for WORKAROUND_GCC_OPTERON_ISSUE
2017-12-08 13:54:00 -05:00
Jeffrey Walton 148202369b
Fix Speck-64 CTR mode
It looks like the delay was due to some GCC 7 issue. We had to disable parallel blocks on Aarch64 with GCC 7. We may be running out of registers and that could be causing problems. It looks like GCC uses up to v30.
2017-12-07 22:30:03 -05:00
Jeffrey Walton 02037b5ce6
Fix Simon-64 CTR mode
This fixes CTR mode for Simon-64. We were only incrementing half the counters.

We still have Speck-64 to cleanup.
2017-12-07 19:45:32 -05:00
Jeffrey Walton 07f2a4fc3f
Fix Simon-64 and Speck-64 CTR mode
This fixes CTR mode for IA-32. We were only incrementing half the counters.
Added additional test vectors
2017-12-07 16:55:23 -05:00
Jeffrey Walton fe257e92a9
Add const-ness to internal BLAKE2 functions (GH #527) 2017-12-06 17:40:34 -05:00
Jeffrey Walton b436411de5
Fix MSVC 2017 hang on BLAKE2 (GH #527)
It looks like the macros for BLAKE2B and BLAKE2S round functions were too much for the compiler to handle
2017-12-06 14:02:28 -05:00
Jeffrey Walton 86acc8ed45
Use 6x-2x-1x for Simon and Speck on IA-32
For Simon-64 and Speck-64 this means we are effectively using 12x-4x-1x. We are mostly at the threshold for IA-32 and parallelization. At any time 10 to 13 XMM registers are being used.

Prefer movsd by way of _mm_load_sd and _mm_store_sd.

Fix "error C3861: _mm_cvtsi128_si64x identifier not found".
2017-12-06 06:18:46 -05:00
Jeffrey Walton e9654192f2
Remove unneeded temp[] array 2017-12-05 20:35:57 -05:00
Jeffrey Walton 490701acca
Use 12x-4x-1x for Simon and Speck on ARM 2017-12-05 18:43:53 -05:00
Jeffrey Walton 7bc621da62
Enable NEON/ASIMD for Simon and Speck on Aarch32/Aarch64 (GH #545) 2017-12-05 14:02:48 -05:00
Jeffrey Walton 9b61d4143d
Add big- and little-endian rotates for Aarch32 and Aarch64 2017-12-05 12:32:26 -05:00
Jeffrey Walton 9faa504a24
Fix Aarch32 and Aarch64 rotates 2017-12-05 11:15:26 -05:00
Jeffrey Walton c18793f862
Fix SIMON-64 missing transform 2017-12-05 09:14:58 -05:00
Jeffrey Walton 4990ffe5b8
Add SIMON-64 NEON intrinsics 2017-12-05 08:53:57 -05:00