Commit Graph

251 Commits (c797bd9523549add671b913aba5cb4a3669bdace)

Author SHA1 Message Date
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