Commit Graph

347 Commits

Author SHA1 Message Date
Jeffrey Walton
f165d1822d
More SunStudio/SunCC workarounds 2018-07-27 01:51:27 -04:00
Jeffrey Walton
9d954efcde
Disable CLMUL again on SunStudio (GH# 188, GH #224)
We got reports that x86_64 was producing incorrect results. Also, the problem persisted in i386 builds. I don't think we can work around this issue. Oracle must fix it.
2018-07-16 09:39:01 -04:00
Jeffrey Walton
4e3a1ea962
Add ARMv8.4 cpu feature detection support (GH #685) (#687)
This PR adds ARMv8.4 cpu feature detection support. Previously we only needed ARMv8.1 and things were much easier. For example, ARMv8.1 `__ARM_FEATURE_CRYPTO` meant PMULL, AES, SHA-1 and SHA-256 were available. ARMv8.4 `__ARM_FEATURE_CRYPTO` means PMULL, AES, SHA-1, SHA-256, SHA-512, SHA-3, SM3 and SM4 are  available. 

We still use the same pattern as before. We make something available based on compiler version and/or preprocessor macros. But this time around we had to tighten things up a bit to ensure ARMv8.4 did not cross-pollinate down into ARMv8.1.

ARMv8.4 is largely untested at the moment. There is no hardware in the field and CI lacks QEMU with the relevant patches/support. We will probably have to revisit some of this stuff in the future.

Since this update applies to ARM gadgets we took the time to expand Android and iOS testing on Travis. Travis now tests more platforms, and includes Autotools and CMake builds, too.
2018-07-15 08:35:14 -04:00
Jeffrey Walton
d11a7b3436
Add ARMv8 CPU feature queries (GH #685)
CPU feature probes are still outstanding. They are going to be trickier because if CRYPTOPP_XXX_FEATURE_AVAILABLE
2018-07-14 08:20:16 -04:00
Jeffrey Walton
b3fe24b8b5
Remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support (GH #682)
We were able to gut CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS for everything except Rijndael. Rijndael uses unaligned accesses on x86 to harden against timing attacks.
There's a little more to CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS and Rijndael. If we remove unaligned access then AliasedWithTable hangs in an endless loop on non-AESNI machines. So care must be taken when trying to remove the vestige from Rijndael.
2018-07-11 11:40:25 -04:00
Jeffrey Walton
1e77a72ed6
Disable Cryptogams AES under Clang
What a surprise... Clang pretends to be GCC with __GNUC__ but fails to consume the source file
2018-07-11 09:19:11 -04:00
Jeffrey Walton
3ff7d7f028
Add ARM AES asm implementation from Cryptogams (GH #683) 2018-07-11 06:59:44 -04:00
Jeffrey Walton
da32ed4679
Fix versioning that cross-pollinated when building docs 2018-07-01 03:46:11 -04:00
Jeffrey Walton
c58ea35e23
Update documentation 2018-07-01 03:42:17 -04:00
Jeffrey Walton
188e0df650
Rename CRYPTOPP_DISABLE_SHA → CRYPTOPP_DISABLE_SHANI …
This aligns both config.h and Cmake. Also see Gentoo Issue 654598 (https://bugs.gentoo.org/654598)
2018-05-04 10:10:50 -04:00
Jeffrey Walton
5422f0c13a
Rename CRYPTOPP_DISABLE_AES → CRYPTOPP_DISABLE_AESNI
This aligns both config.h and Cmake. Also see Gentoo Issue 654598 (https://bugs.gentoo.org/654598)
2018-05-03 21:28:17 -04:00
Jeffrey Walton
4bb331f5d0
Post-release version increment 2018-04-08 15:58:25 -04:00
Jeffrey Walton
c8d8caf700
Prepare for Crypto++ 7.0 release 2018-04-08 04:48:59 -04:00
Jeffrey Walton
3958fad099
Add sbyte, sword16, sword32 and sword64 (GH #608, GH #609)
Visual Studio 2008 kind of forced out hand with this. VS2008 lacks <stdint.h> and <cstdint> and it caused compile problems in NaCl gear. We were being a tad bit lazy by relying on int8_t, int32_t and int64_t, but the compiler errors made us act
2018-03-27 20:47:20 -04:00
Jeffrey Walton
0630d46fe8
Add PowerPC Power8 SHA hashing (GH #513)
Perforance increases significantly, but there's still room for improvement. Even OpenSSL's numbers are relatively dull. We expect Power8's SHA-256 to be somewhere between 2 to 8 cpb but we are not hitting them.

SHA-256, GCC112 (ppc64-le): C++ 23.43, Power8 13.24 cpb (+ 110 MiB/s)
SHA-256, GCC119 (ppc64-be): C++ 10.16, Power8  9.74 cpb (+ 50 MiB/s)

SHA-512, GCC112 (ppc64-le): C++ 14.00, Power8 9.25 cpb (+ 150 MiB/s)
SHA-512, GCC119 (ppc64-be): C++ 21.05, Power8 6.17 cpb (+ 450 MiB/s)
2018-03-10 16:19:11 -05:00
Jeffrey Walton
f1a3da834a
Tie CRYPTOPP_CXX17 to CRYPTOPP_CXX11 2018-03-05 06:47:05 -05:00
Jeffrey Walton
da11d90ddb
Post-release version increment 2018-02-22 12:47:18 -05:00
Jeffrey Walton
f83550809d
Fix __cplusplus version for C++17
Formerly we were using 201402L from N4594, and it caused a compile failure when using -std=c++14
2018-02-21 18:01:31 -05:00
Jeffrey Walton
143f5a3079
Handle C++17 std::uncaught_exceptions (GH #590) 2018-02-21 09:59:52 -05:00
Jeffrey Walton
a0e2177996
Add define for CRYPTOPP_DISABLE_ASM
We probably should have documented it some time ago, after we added NEON and ARMv8
2018-02-17 10:51:55 -05:00
Jan Beich
6e8f6630cf Fix Clang check for C++11 lambdas (GH #558, citra-emu/citra#3435) (#587)
$ CXXFLAGS=-std=gnu++17 gmake
clang++ -std=gnu++17 -fPIC -pthread -pipe -c cryptlib.cpp
In file included from cryptlib.cpp:19:
./misc.h:2542:43: error: no member named 'bind2nd' in namespace 'std'
    return std::find_if(first, last, std::bind2nd(std::not_equal_to<T>(), value));
                                     ~~~~~^
1 error generated.
2018-02-14 21:35:46 -05:00
Jeffrey Walton
a876d82445
Move CRYPTOPP_POSIX_MEMALIGN_AVAILABLE preference down
This should result in fewer surprises
2018-01-30 22:03:34 -05:00
Jeffrey Walton
7141d026c1
Switch to posix_memalign when available
It is easier to defer to the runtime for aligned allocations. We found the preprocessor macros needed to identitify the availability. Also see https://forum.kde.org/viewtopic.php?p=66274
2018-01-30 21:14:24 -05:00
Jeffrey Walton
22e783a378
Switch to posix_memalign when available
It is easier to defer to the runtime for aligned allocations. We found the preprocessor macros needed to identitify the availability. Also see https://forum.kde.org/viewtopic.php?p=66274
2018-01-30 21:05:55 -05:00
Jeffrey Walton
e21f882f50
Switch to posix_memalign for FreeBSD 2018-01-29 17:39:25 -05:00
Jeffrey Walton
c4392c40e0
Fix misaligned SSE2 allocations on FreeBSD (GH #562)
This may have something to do with https://github.com/monero-project/kovri/pull/788
2018-01-29 17:05:25 -05:00
Jeffrey Walton
0de445b56a
Tie SHA availability to SSE4.2 availability
This cleanly sidesteps an Android compile failure without CRYPTOPP_DISABLE_SHA
2018-01-28 16:10:41 -05:00
Jeffrey Walton
78c9a6e459
Update documentation 2018-01-25 15:59:47 -05:00
Jeffrey Walton
19e07938fa
Post-release version increment
Also see https://www.cryptopp.com/wiki/Release_Versioning#Post-Release_Increment
2018-01-22 17:21:22 -05:00
Jeffrey Walton
aee296d663
Fix AIX AlignedAllocate
Well, the IBM docs were not quite correct when they stated "The block is aligned so that it can be used for any type of data". The vector data types are pretty standard, even across different machines from diffent manufacturers
2018-01-21 19:48:36 -05:00
Jeffrey Walton
d6cf3b5020
Simplify logic for selection of word128 2018-01-21 16:25:09 -05:00
Jeffrey Walton
c4e0942a68
Add CRYPTOPP_TABLE, remove CRYPTOPP_SECTION 2018-01-21 14:19:00 -05:00
Jeffrey Walton
5cee4a6573
Improve logic for <arm_acle.h> include (GH #568) 2018-01-20 13:23:41 -05:00
Jeffrey Walton
a1deaf73c1 Revert "Update documentation"
This reverts commit 4050312. The version change used to build the documentation cross-polinated into the commit.
2018-01-19 08:04:46 -05:00
Jeffrey Walton
4050312025
Update documentation 2018-01-19 08:03:40 -05:00
Jeffrey Walton
13ea8f374f
Add interface to TweetNaCl library (#566)
TweetNaCl is a compact reimplementation of the NaCl library by Daniel J. Bernstein, Bernard van Gastel, Wesley Janssen, Tanja Lange, Peter Schwabe and Sjaak Smetsers. The library is less than 20 KB in size and provides 25 of the NaCl library functions.

The compact library uses curve25519, XSalsa20, Poly1305 and SHA-512 as default primitives, and includes both x25519 key exchange and ed25519 signatures. The complete list of functions can be found in TweetNaCl: A crypto library in 100 tweets (20140917), Table 1, page 5.

Crypto++ retained the function names and signatures but switched to data types provided by <stdint.h> to promote interoperability with Crypto++ and avoid size problems on platforms like Cygwin. For example, NaCl typdef'd u64 as an unsigned long long, but Cygwin, MinGW and MSYS are LP64 systems (not LLP64 systems). In addition, Crypto++ was missing NaCl's signed 64-bit integer i64.

Crypto++ enforces the 0-key restriction due to small points. The TweetNaCl library allowed the 0-keys to small points. Also see RFC 7748, Elliptic Curves for Security, Section 6.

TweetNaCl is well written but not well optimized. It runs 2x to 3x slower than optimized routines from libsodium. However, the library is still 2x to 4x faster than the algorithms NaCl was designed to replace.

The Crypto++ wrapper for TweetNaCl requires OS features. That is, NO_OS_DEPENDENCE cannot be defined. It is due to TweetNaCl's internal function randombytes. Crypto++ used DefaultAutoSeededRNG within randombytes, so OS integration must be enabled. You can use another generator like RDRAND to avoid the restriction.
2018-01-17 22:02:09 -05:00
Jeffrey Walton
4e86f42d78
Fix Andoid ARMv8 builds
This toolchain is pretty lame. It does not make CRC or Crypto intrinsics available
2018-01-17 20:34:11 -05:00
Jeffrey Walton
5ae79afd89
Add CRYPTOPP_CXX11_LAMBDA for N2927 (v1.1) (GH #558) 2018-01-07 21:35:12 -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
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
e90cc9a028
Update comments 2017-12-10 05:41:19 -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
14e326482c
Update comments 2017-11-30 02:07:04 -05:00
Jeffrey Walton
61ec50dabe
Change Doxygen comment style from //! to ///
Also see https://groups.google.com/forum/#!topic/cryptopp-users/A7-Xt5Knlzw
2017-11-29 10:54:33 -05:00
Jeffrey Walton
571cbf058c
Fix LLVM detection of SSSE3 on 32-bit cpus 2017-11-24 21:38:49 -05:00
Jeffrey Walton
b08596da44
Add CRYPTOPP_SLOW_ARMV8_SHIFT for Aarch32 and Aarch64
Both BLAKE2 and SPECK slow down when using NEON/ASIMD. When just BLAKE2 experienced the issue, it was a one-off problem. Its now wider than a one-off, so add the formal define
2017-11-23 02:22:27 -05:00
Jeffrey Walton
027a1a3d8c
Fix AES detection on AIX and Power8
This got knocked loose when adding Autotools support
2017-11-20 19:50:07 -05:00
Jeffrey Walton
156fedea7f Revert "Remove master-merge script"
This reverts commit d3dc091. A version number change used to build the docs cross-pollinated into the deletion of the script.
2017-11-16 12:53:33 -05:00
Jeffrey Walton
d3dc09120b
Remove master-merge script
We don't use branches for development because they pollute the logs on Master
2017-11-16 12:51:33 -05:00
Jeffrey Walton
a3784a3ac5
Update Power8 support for Autotools 2017-11-14 20:54:43 -05:00
Jeffrey Walton
bf717f47e6
Reduce C++ file scope class objects
Update comments and documentation
2017-11-12 11:55:57 -05:00
Jeffrey Walton
69c8a4f9c6
Prefix IS_LITTLE_ENDIAN and IS_BIG_ENDIAN with CRYPTOPP 2017-11-10 14:15:30 -05:00
Marcel Raad
4043164205 RFC: workarounds for original MinGW (#531)
* Set default target Windows version for MinGW to XP

The original MinGW from mingw.org targets Windows 2000 by default, but lacks
the <wspiapi.h> include needed for Windows 2000 support.

* Disable CRYPTOPP_CXX11_SYNCHRONIZATION for original MinGW

std::mutex is only available in libstdc++ if _GLIBCXX_HAS_GTHREADS is defined,
which is not the case for original MinGW. Make the existing fix for AIX more
general to fix this. Unfortunately, any C++ header has to be included to
detect the standard library and the otherwise empty <ciso646> is going to be
removed from C++20, so use <cstddef> instead.
2017-11-06 20:49:16 -05:00
Jeffrey Walton
e4cef84883
Add CRYPTOPP_NO_CXX11 for fake C++11 standard libraries (GH #529)
This is a recurring problem, especially on MinGW and platforms that use STLport. See the bug report for some references
2017-11-06 09:09:45 -05:00
Jeffrey Walton
7ba8c6bc81
Cleanup Altivec and Power7 code paths
This changes the dependency from Altivec to Power7. Internally we needed Power7 but it was cut-in as a pseudo Altivec dependency. Also see http://groups.google.com/forum/#!topic/cryptopp-users/fmEKOG41SG8
2017-10-17 22:50:45 -04:00
Jeffrey Walton
f8d97b83ed
Fix compile on old PowerPC
This cleans up the compile on old PwerMac G5's. Our Altivec and Crypto code relies on Power7 and Power8 extensions. There's no need to shoehorn Altivec and Power4 into old platforms, so we disable Altivec and Crypto unless Power7 is available. The GNUmakefile sets CRYPTOPP_DISABLE_ALTIVEC if Power7 is not available.
2017-10-17 20:47:14 -04:00
Jeffrey Walton
1315c1fe2f
Fix unwanted inlining of factory.h classes on AIX and Power7
Enable aligned allocations under IBM XL C/C++. Based on the AIX malloc man pages, "... the block is aligned so that it can be used for any type of data". Previously CRYPTOPP_NO_ALIGNED_ALLOC was in effect.

Use malloc instead of calloc on OS X. Based on the OS X malloc man pages, "... the allocated memory is aligned such that it can be used for any data type, including AltiVec- and SSE-related types". Additionally, calloc zero'd the memory it allocated which slowed things down on Apple systems.
2017-10-13 04:13:39 -04:00
Jeffrey Walton
4b7549a990
Use 'static const int' for constant Borland/Embarcadero (GH #512) 2017-09-20 18:18:51 -04:00
Jeffrey Walton
6102333fc3
Add CRYPTOPP_NO_CPU_FEATURE_PROBES (GH #511)
We determine machine capabilities by performing an os/platform *query* first, like getauxv(). If the *query* fails, we move onto a cpu *probe*. The cpu *probe* tries to exeute an instruction and then catches a SIGILL on Linux or the exception EXCEPTION_ILLEGAL_INSTRUCTION on Windows. Some OSes fail to hangle a SIGILL gracefully, like Apple OSes. Apple machines corrupt memory and variables around the probe.
2017-09-19 21:08:37 -04:00
Jeffrey Walton
f0c2324f6b
Fix armeabi and armv7-a for Android (GH #509) 2017-09-17 20:07:53 -04:00
Jeffrey Walton
4c6a866a8d
Remove debug info statement from makefile 2017-09-13 18:51:45 -04:00
Jeffrey Walton
8d98417306
Add Aarch64 specific defines to Android cross-compile
Move <arm_acle.h> logic into "sonfig.h". Detecting when we can/should include <arm_acle.h> is proving to be troublesome
2017-09-13 17:16:57 -04:00
Jeffrey Walton
fb78afba29
Add PowerPC support to cpu.h and validate.cpp 2017-09-11 03:05:04 -04:00
Jeffrey Walton
263c38d681
Avoid pthread gear for IBM XL C/C++ compiler on AIX 2017-09-09 16:25:15 -04:00
Jeffrey Walton
37e02f9e0e
Revert AltiVec and Power8 commits
The strategy of "cleanup under-aligned buffers" is not scaling well. Corner cases are still turing up. The library has some corner-case breaks, like old 32-bit Intels. And it still has not solved the AltiVec and Power8 alignment problems.
For now we are backing out the changes and investigating other strategies
2017-09-05 16:28:00 -04:00
Jeffrey Walton
b9e871d1e8
Add PPC, PPC64, AltiVec and Power8 awareness
We are going to try AltiVec/Powe8 crypto. It appears to be a lot like ARMv8-a crypto
2017-09-02 19:25:37 -04:00
Jeffrey Walton
069ae2a179
Fix missing object factory of xlC on AIX 2017-09-01 03:58:45 -04:00
Jeffrey Walton
6c35eaf737
Update test script for AIX 2017-08-31 08:05:48 -04:00
Jeffrey Walton
0d6f349749
Fold CXX11 feature block 2017-08-31 06:41:44 -04:00
Jeffrey Walton
67bcdaed9a
Fix compile under AIX 7.1 2017-08-31 06:29:35 -04:00
Jeffrey Walton
8624587943
Remove WORKAROUND_MS_BUG_Q258000 from the config and osrng 2017-08-29 14:48:08 -04:00
Jeffrey Walton
a3b035b6a8
Add CRYPTOPP_CXX11_ENUM (Issue 475) 2017-08-28 17:37:59 -04:00
Jeffrey Walton
f488221992
Test align 16 for i386 and x86_64 2017-08-27 19:01:00 -04:00
Jeffrey Walton
5c6a32ba0f
Support Base Implementation + SIMD implementation on Solaris (PR #461) 2017-08-24 19:17:21 -04:00
Jeffrey Walton
7851a0d510 Remove BOOL macro value (GH #462)
Currently the CRYPTOPP_BOOL_XXX macros set the macro value to 0 or 1. If we remove setting the 0 value (the #else part of the expression), then the self tests speed up by about 0.3 seconds. I can't explain it, but I have observed it repeatedly.
This check-in prepares for the removal in Upstream master
2017-08-20 21:25:29 -04:00
Jeffrey Walton
61c8b74951
Add Divisor and MSR member variables
Guard ASM based on CRYPTOPP_X86_ASM_AVAILABLE
Increased depth of internal buffer
Update documentation for using the generator
Whitespace check-in
2017-08-20 04:09:19 -04:00
Jeffrey Walton
a9534a7cf3
Use CRYPTOPP_SSE2_INTRIN_AVAILABLE for consistent naming 2017-08-18 02:11:41 -04:00
Jeffrey Walton
e2c377effd Split source files to support Base Implementation + SIMD implementation (GH #461)
Split source files to support Base Implementation + SIMD implementation
2017-08-17 12:33:43 -04:00
Jeffrey Walton
7779fa3e7a
Fix NEON detection on Aarch32 and Aarch64
I wish GCC would get its head out of its ass and define the apprpriate defines. NEON/ASIMD cannot be disgorged from Aarch32/Aarch64 just like SSE2 cannot be disgorged from x86_64. They are core instruction sets
2017-08-17 02:15:42 -04:00
Jeffrey Walton
b0b749f392
Fold shuffles after loads for SHACAL2 2017-08-16 10:40:00 -04:00
Jeffrey Walton
c5c6a6af5c
Fix Doxygen constant documentation 2017-08-16 05:11:37 -04:00
Jeffrey Walton
953252e44d
Move from 'static' to 'enum' for class constants
Enums don't take up space in class objects. Its should result in smaller objects and faster code
2017-08-11 17:13:15 -04:00
Jeffrey Walton
326700f6ec
Fix library version numbers
They were inadvertently checked-in with the SHA doc updates
2017-08-05 01:08:25 -04:00
Jeffrey Walton
d779462a38
Update documentation 2017-08-05 01:05:58 -04:00
Jeffrey Walton
3fc7b104e6
Update documentation 2017-07-28 12:35:25 -04:00
Jeffrey Walton
5103f6dd41
Remove gyrations around CRYPTOPP_NO_UNALIGNED_DATA_ACCESS
CRYPTOPP_NO_UNALIGNED_DATA_ACCESS was required in Crypto++ 5.6 and earlier because unaligned data access was the norm. It caused problems at -O3 and on ARM NEON.
At Crypto++ 6.0 no unaligned data access became a first class citizen. Folks who want to allow it must now define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
2017-07-23 11:14:02 -04:00
Jeffrey Walton
00f9818b5d
Move byte to Crypto++ namespace (Issue 442)
Also see http://www.cryptopp.com/wiki/std::byte and http://github.com/weidai11/cryptopp/issues/442
2017-07-20 09:55:29 -04:00
Marcel Raad
32f715f1d7 Fix Windows XP support on Visual Studio 2015+ (#439)
When compiling with Visual Studio 2015+, Crypto++ uses CryptoNG by
default. CryptoNG is only available on Windows Vista and later and
Crypto++ currently ignores if the user explicitly wants to target
Windows XP. Unlike with other Windows SDK features, everything
compiles, but the application doesn't start on Windows XP because
bcrypt.dll is missing. That is an issue when updating Visual Studio
because the root cause is hard to find.
Making use of CryptoNG when targeting Windows 8+ instead by default,
regardless of the Visual Studio version, to fix this.
2017-06-24 17:41:20 -04:00
Jeffrey Walton
429047a8e9
Clear Visual Studio warnings (Issue 412) 2017-06-02 07:13:43 -04:00
Jeffrey Walton
7ac77ca9ac Revert "Revert "Clear Visual Studio warnings (Issue 412)""
This reverts commit c3871aec94.
2017-06-02 05:18:52 -04:00
Jeffrey Walton
c3871aec94 Revert "Clear Visual Studio warnings (Issue 412)"
This reverts commit eb3b27a6a5. The change broke GCC 4.8 and unknown version of Clang on OS X. UB reported the OS X break, and JW found duplicated the break on a ARM CubieTruck with GCC 4.8.
2017-06-02 05:06:56 -04:00
Jeffrey Walton
eb3b27a6a5
Clear Visual Studio warnings (Issue 412) 2017-05-30 16:37:41 -04:00
Jeffrey Walton
f40c55810d
Add method for sanitizer suppression 2017-05-21 21:51:31 -04:00
Jeffrey Walton
5f0cbde980
Removed MSVC warning suppression for many warnings (Issue 412)
Most of these appear to have been cleared over the last couple of years.

C4127 is too prevelant. We are probably going to have to live with it.

We may be able to clear C4250 with a using statement. For example 'using ASN1CryptoMaterial::Load'.

MSVC resisted clearing C4661 by pushing/poping in iterhash.h and osrng.h. It was like MSVC simply ignored it.
2017-05-16 03:52:03 -04:00
Jeffrey Walton
0611e11507
Disable word128 for PPC64 and GCC 4.8 (Issue 421) 2017-05-12 23:51:27 -04:00
Jeffrey Walton
554b7a2747
Fix "error: inlining failed ... target specific option mismatch (Issue 407) 2017-05-01 17:54:05 -04:00
Jeffrey Walton
8ded8bc38d
Clear SunCC anachronism warning "Attempt to redefine IS_BIG_ENDIAN without using #undef" 2017-04-21 23:52:43 -04:00
Jeffrey Walton
65c3c63b52
Breakout and cleanup macros. Add CRYPTOPP_ENABLE_ARIA_SSE2_INTRINSICS, CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS and CRYPTOPP_ENABLE_ARIA_NEON_INTRINSICS.
Tune CRYPTOPP_ENABLE_ARIA_SSE2_INTRINSICS and CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS macro for older GCC and Clang. Clang needs some more tuning on Aarch64 becuase performance is off by about 15%.

Add additional NEON code paths.

Remove keyBits from Aarch64 code paths.
2017-04-13 17:45:58 -04:00
Jeffrey Walton
35f95fb739
Fix unaligned pointer crash on Win32 due to _mm_load_si128
The SSSE3 intrinsics were performing aligned loads using _mm_load_si128 using user supplied pointers. The pointers are only a byte pointer, so its alignment can drop to 1 or 2. Switching to _mm_loadu_si128 will sidestep potential problems. The crash surfaced under Win32 testing.

Switch to memcpy's when performing bulk assignment x[0]=y[0] ... x[3]=y[3]. I believe Yun used the pattern to promote vectorization. Some compilers appear to be braindead and issue integer move's one word at a time. Non-braindead compiler will still take the optimization when advantageous, and slower compilers will benefit from the bulk move. We also cherry picked vectorization opportunities, like in ARIA_GSRK_NEON.

Remove keyBits variable. We now use UncheckedSetKey's keylen throughout.

Also fix a typo in CRYPTOPP_BOOL_SSSE3_INTRINSICS_AVAILABLE. __SSSE3__ was listed twice.
2017-04-13 04:28:02 -04:00