Commit Graph

288 Commits (f5c86217c0d6c76d6b43c93b63f6670228aab5fb)

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