Commit Graph

321 Commits

Author SHA1 Message Date
Jeffrey Walton
41639e5ec6
Fix ARM A-32 and Aarch64 feature tests (PR #737) 2018-11-12 14:59:36 -05:00
Jeffrey Walton
a0f3744ed4
Use __cpp_lib_uncaught_exceptions for CRYPTOPP_CXX17_EXCEPTIONS
Also see https://bugs.llvm.org/show_bug.cgi?id=39631
2018-11-12 03:37:32 -05:00
Jeffrey Walton
896225069d
Rename files with dashes to underscores (GH #736)
Also see https://groups.google.com/forum/#!topic/cryptopp-users/HBz-6gZZFOA on the mailing list
2018-11-10 08:00:14 -05:00
Jeffrey Walton
f839e5093c
Enable SSE2 intrinsics for SunCC 2018-11-09 20:35:27 -05:00
Jeffrey Walton
d9011f07d2
Add ChaCha AVX2 implementation (GH #735) 2018-11-08 16:20:31 -05:00
Jeffrey Walton
c601213ce1
Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools
Autotools sets up its config.h file with the '#define XXX 0' or '#define XXX 1' pattern. This check-in makes the sources Autotools aware. We need to verify CMake does the same
2018-10-28 04:24:22 -04:00
Jeffrey Walton
e185cbd803 Revert "Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools"
This reverts commit 04306f86ac. It broke GCC 4.8 on PowerPC.
2018-10-28 03:42:50 -04:00
Jeffrey Walton
1cf4f98df8
Update comments 2018-10-27 12:46:01 -04:00
Jeffrey Walton
04306f86ac
Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools 2018-10-27 07:30:15 -04:00
Jeffrey Walton
d230999b40
Fix ChaCha compile on ARM and MIPS 2018-10-24 01:11:45 -04:00
Jeffrey Walton
1de4f39f86
Add CRYPTOPP_DISABLE_ASM for Google Native Client (GH #719) 2018-10-20 06:31:51 -04:00
Jeffrey Walton
1bbbfb6b75
Fix partial specializations for FixedSizeAllocatorWithCleanup (PR #710)
Commit afbd3e60f6 effectively treated a symptom and not the underlying problem. The problem was linkers on 32-bit systems ignore CRYPTOPP_ALIGN_DAT(16) passed down by the compiler and align to 8-bytes or less. We have to use Wei's original code in some places. It is not a bad thing, but the bit fiddling is something we would like to contain a little more by depending more on language or platform features.

This commit keeps the original changes which improve partial specializations; but fixes 32-bit linker behavior by effectively reverting afbd3e60f6 and e054d36dc8. We also add more comments so the next person has understands why things are done they way they are.
2018-08-24 08:13:23 -04:00
Jeffrey Walton
e054d36dc8
Add partial specializations for FixedSizeAllocatorWithCleanup
This allocator still has some demons buried inside due to the bit fiddling. This commit should isolate the demons to aligned stack allocations when an alignment facility from the platform or OS is not available. That is, we use CRYPTOPP_ALIGN_DATA when we can because it is most reliable.
We can tell when things have gone sideways using Debug builds. The CRYPTOPP_ASSERT(m_allocated) will fire on destruction because the flag gets overwritten.
2018-08-23 07:08:34 -04:00
Jeffrey Walton
31ebabeb1e
Cleanup headers in vmac.cpp 2018-08-18 07:21:42 -04:00
Jeffrey Walton
06cf2ede9e
Disable ASM and intrinsics for ARM big-endian
We don't have a test rig to test things. Based on our experience with Power8 and BE/LE, there will be trouble
2018-08-18 04:31:49 -04:00
Jeffrey Walton
f2171cbe2f
Remove Thread and Socket classes (GH #208, PR #703)
Also see https://groups.google.com/forum/#!topic/cryptopp-users/5btwLoxXXD4.
2018-08-17 23:55:39 -04:00
Jeffrey Walton
9f2d65409a
Add POWER8 GCM mode (GH #698)
Commit 3ed38e42f6 added the POWER8 infrastructure for GCM mode. It also added GCM_SetKeyWithoutResync_VMULL, GCM_Multiply_VMULL and GCM_Reduce_VMULL. This commit adds the remainder, which includes GCM_AuthenticateBlocks_VMULL.
GCC is OK on Linux (ppc64-le) and AIX (ppc64-be). We may need some touchups for XLC compiler
2018-08-09 23:28:49 -04:00
Jeffrey Walton
3ed38e42f6
Add POWER8 GCM mode (GH #698)
GCM_SetKeyWithoutResync_VMULL, GCM_Multiply_VMULL and GCM_Reduce_VMULL work as expected on Linux (ppc64-le) and AIX (ppc64-be). We are still working on GCM_AuthenticateBlocks_VMULL.
2018-08-09 08:09:13 -04:00
Jeffrey Walton
9ff731824b
Prepare for POWER8 carryless multiplies using vpmsum 2018-08-06 05:40:38 -04:00
Jeffrey Walton
f67efe75c9
Remove POWER5 define. We don't use it
The 64-bit 'vector long long' is POWER8
2018-08-03 14:17:13 -04:00
Jeffrey Walton
00135f5b5b
Add CRYPTOPP_ALIGN_DATA for IBM XL C/C++ 2018-07-30 20:32:45 -04:00
Jeffrey Walton
d952cb99c2
Update comments 2018-07-30 12:42:53 -04:00
Jeffrey Walton
973fbf0e2f
Fix FixedSizeAllocatorWithCleanup assert on Solaris 2018-07-30 11:27:50 -04:00
Jeffrey Walton
5ea410c1d3
Update comments 2018-07-27 01:57:33 -04:00
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