Commit Graph

430 Commits (39418a85122fa7954cca6354be30a44d6335874e)

Author SHA1 Message Date
Jeffrey Walton bbc5c63d33
Drop GCM to POWER7 on PowerPC
GCM can do some bulk XOR's using the SIMD unit. However, we still need loads and stores to be fast. Fast loads and stores of unaligned data requires the VSX unit
2018-11-17 00:41:49 -05:00
Jeffrey Walton 4f86bcc39d
Remove -qxlcompatmacros after Commit 96d3fa208e 2018-11-14 20:18:56 -05:00
Jeffrey Walton 7bd02896a0
Fix XLC flags with LLVM front-end 2018-11-14 20:01:05 -05:00
Jeffrey Walton 7c9858f89c
Cleanup PowerPC and XLC feature tests 2018-11-14 08:19:39 -05:00
Jeffrey Walton fc1e98e70d
Make feature test output filename configurable (PR #737, GH #738) 2018-11-13 14:02:40 -05:00
Jeffrey Walton e69106f257
Add "Invalid mnemonic" to bad result on PPC 2018-11-13 01:57:12 -05:00
Jeffrey Walton 9550ccc9a3
Port SIMON64 to Altivec
SIMON64 runs about 4x faster than C++ for POWER4 and friends. If POWER7 is available it goes back to full speed due to efficient unaligned loads
2018-11-12 21:51:11 -05:00
Jeffrey Walton a0608a6b80
Port SPECK64 to Altivec
SPECK64 runs about 4x faster than C++ for POWER4 and friends. If POWER7 is available it goes back to full speed due to efficient unaligned loads
2018-11-12 20:56:15 -05:00
Jeffrey Walton cac97f041d
Rename PPC feature tests to test_ppc_xxx.cxx (PR #737) 2018-11-12 15:43:01 -05:00
Jeffrey Walton ff212dae3e
Rename x86 feature tests to test_x86_xxx.cxx (PR #737) 2018-11-12 15:37:14 -05:00
Jeffrey Walton 41639e5ec6
Fix ARM A-32 and Aarch64 feature tests (PR #737) 2018-11-12 14:59:36 -05:00
Jeffrey Walton 886fd7903d
Remove wildcard from a.out clean recipe 2018-11-12 05:25:01 -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 499a5e289d
Remove a.out artifacts whenever feature tests run (GH #738) 2018-11-12 01:57:09 -05:00
Jeffrey Walton f91584a7bc
Remove a.out artifacts on OS X during clean (GH #738) 2018-11-12 00:56:54 -05:00
Jeffrey Walton 4e404cceeb
Fix incorrect Macport compiler detection (GH #738) 2018-11-11 13:44:39 -05:00
Jeffrey Walton b163176f82
Fix missing 'no such instruction' in assembler messages (GH #738) 2018-11-11 13:35:03 -05:00
Jeffrey Walton de75959fd7
Move HAS_NEWLIB down to _XOPEN_SOURCE test 2018-11-11 11:54:58 -05:00
Jeffrey Walton 40da78e5ad Cleanup GNUmakefile (PR #737) 2018-11-11 09:59:55 -05:00
Jeffrey Walton 213569a46d
Remove Darwin requirement for Port compilers
I seem to recall someone used one on Linux at one time
2018-11-11 07:53:49 -05:00
Jeffrey Walton 6e94562c52
Move to feature-based availability testing in Makefile (PR #737) 2018-11-11 01:14:43 -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 aa1d0a5129
Lower Binutil version to 2.23 for AVX 2018-11-08 19:03:33 -05:00
Jeffrey Walton d9011f07d2
Add ChaCha AVX2 implementation (GH #735) 2018-11-08 16:20:31 -05:00
Jeffrey Walton 5dca85b819
Split Blake2 SIMD files into blake2s-simd.cpp and blake2b-simd.cpp (GH #729, GH #731)
The split was required for Blake2b and Power8; Blake2s only requires Power7
2018-11-02 19:09:36 -04:00
Jeffrey Walton 659c0c113c
Add BLAKE2b Power8 implementation (GH #729) 2018-10-30 06:20:31 -04:00
Jeffrey Walton 81db4ea5e3
Switch to pch.cpp for compile tests.
adhoc.cpp was a bit uncomfortable because we had to copy it out from adhoc.cpp.proto. For some reason CMake could not perform the copy, so we started using pch.cpp in CMake. This commit keeps them consistent.
We may have problems with one test, and that is the Newlib tests. I seem to recall they a C++ header included to properly identify its use. We cross that bridge during MinGW testing.
2018-10-29 08:41:54 -04:00
Jeffrey Walton d7d76fa5f7
Add ChaCha Power8 implementation 2018-10-27 08:40:07 -04:00
Jeffrey Walton 21d69598ab
Add CRYPTOPP_DISABLE_ASM to dependency recipe
This stops the inclusion of SSE headers without arch options that break the recipe
2018-10-26 11:10:07 -04:00
Jeffrey Walton 18dcbdf514
Move input xor to ChaCha_OperateKeystream_SSE2
This picks up about 0.2 cpb in ChaCha::OperateKeystream. It may not sound like much but it puts SSE2 intrinsics version on par with the ASM version of Salsa20. Salsa20 leads ChaCha by 0.1 to 0.15 cpb, which equates to about 50 MB/s.
2018-10-24 11:00:35 -04:00
Jeffrey Walton b51faab9b3
Update comments in GNU Makefile 2018-09-09 03:44:50 -04:00
Jeffrey Walton 03297cdfa6
Add -xregs=no%appl for SunCC on Sparc 2018-09-09 03:01:10 -04:00
Jeffrey Walton 243673c32a
Add notes on -stdlib=libc++ for MacOS 2018-08-24 04:43:12 -04:00
Jeffrey Walton f3238742b2
Fix compile with IBM XLC
-pthread was causing "xlC: 1501-210 (W) command option t contains an incorrect subargument"
2018-08-23 04:56:45 -04:00
Jeffrey Walton 899236b99c
Tweak Makefile test to compile but not link (GH #707) 2018-08-21 06:28:28 -04:00
Jeffrey Walton 5489cfe3c6
Remove Asan workaround from VMAC
I was not able to duplicate it under GCC. That includes the GCC's supplied with Debian 8 and Ubuntu 14. It looks like the problem was with Asan insread of the library
2018-08-19 08:32:23 -04:00
Jeffrey Walton 5e3f38cf86
Allow previous version of shared library on Solaris 2018-08-19 07:04:19 -04:00
Jeffrey Walton 3e23c55885
Remove makefile debug print statements 2018-08-19 06:12:09 -04:00
Jeffrey Walton 9886b555d0
Add SONAME to shared object for Solaris
Also see https://blogs.oracle.com/solaris/how-to-name-a-solaris-shared-object-v2
2018-08-19 06:10:30 -04:00
Jeffrey Walton 964b92b614
Rework -pthread test for GCC on Solaris
It looks like GCC is rejecting the -pthread option but it is advertising Pthread support by defining 39 related macros. I'm not sure what to make of it, but we can't use -pthread because it breaks the compile.
2018-08-18 23:51:14 -04:00
Tanzinul Islam ea05f2fefd Fix build for MinGW due to deleted winpipes.cpp (#705)
On my MinGW-w64 setup, the build failed:

>mingw32-make: *** No rule to make target 'winpipes.o', needed by 'libcryptopp.a'.
>mingw32-make: Target 'default' not remade because of errors.

Looks like `winpipes.cpp` was removed in f2171cbe2 but not de-listed from the `GNUmakefile`. Remove it.
2018-08-18 11:17:50 -04:00
Jeffrey Walton 7a43a04048
Split simon-simd.cpp and speck-simd.cpp into separate source files
SIMON-64 and SIMON-128 have different ISA requirements. The same applies to SPECK-64 and SPECK-128. GCC generated code that resulted in a SIGILL due to the ISA differences on a down level machine. The instructions was a mtfprwz from POWER8. It was prsent in a function prologue on a POWER7 machine.
2018-08-15 09:59:40 -04:00
Jeffrey Walton 6c621f91ce
Add POWER8 SIMON-128 implementation
Performance went from about 30 to 40 cpb to 5.5 to 9 cpb, depending on endian-ness
2018-08-12 09:21:09 -04:00
Jeffrey Walton 898dab99b8
Add POWER8 SPECK-128 implementation
Performance went from about 14 cpb to 2-3 cpb, depending on endian-ness
2018-08-12 04:08:33 -04:00
Jeffrey Walton d4428d7f1c
Add VectorLoad and VectorStore test code
Applies to POWER4 and above only
2018-08-06 22:19:59 -04:00
Jeffrey Walton 58b7abe106
Update comments 2018-08-05 12:32:36 -04:00
Jeffrey Walton 1dd0e321a6
Rework Makefile and ppc-simd.h for XLC and LLVM front-end changes 2018-08-05 05:39:42 -04:00
Jeffrey Walton e82ee1c6f0
Fix typo in SM4 recipe on PowerPC 2018-08-04 20:28:31 -04:00
Jeffrey Walton aee00b69ad
Clean *.lst files created by XLC 2018-08-04 20:18:50 -04:00
Jeffrey Walton 5367d26327
Fix compile when adhoc.cpp is missing 2018-07-31 13:33:57 -04:00
Jeffrey Walton 8c3658fce8
Rework GNUmakefiles for XL C/C++ changes 2018-07-31 02:13:17 -04:00
Jeffrey Walton b4a041a71b
Add -qxlcompatmacros for IBM XL C/C++ when available
Also see https://lists.tetaneutral.net/pipermail/cfarm-users/2018-July/000331.html
2018-07-30 23:22:10 -04:00
Jeffrey Walton 4b13ccea5d
Remove automatic bitness selection on PPC64 2018-07-30 20:40:05 -04:00
Jeffrey Walton 0c8a9458cc
Fix compile for AIX using GCC and IBM XL C/C++ 2018-07-30 19:14:51 -04:00
Jeffrey Walton d51f701e06
Refactor validat5.cpp and validat6.cpp
Also see https://groups.google.com/forum/#\!topic/cryptopp-users/j_aQj6r-PoI
2018-07-29 20:30:19 -04:00
Jeffrey Walton 98e35d2925
Remove addition of -m32|-m64 from GNUmakefile
Sun recommends 32-bit binaries instead of 64-bit ones, even on amd64 and sparcv9
2018-07-29 14:37:25 -04:00
Jeffrey Walton 138ce8f626
Cleanup Makefiles and Android and iOS scripts 2018-07-28 18:45:37 -04:00
Jeffrey Walton 28fe1a6a4d
Split validat*.cpp source files
Also see https://groups.google.com/forum/#\!topic/cryptopp-users/j_aQj6r-PoI
2018-07-28 14:57:12 -04:00
Jeffrey Walton 0ea807f2eb
Add additional artifacts to autotools-clean rule 2018-07-28 12:38:15 -04:00
Jeffrey Walton 5cc3f72d33
Add -Wa,--noexecstack for aes-armv4.S 2018-07-28 10:36:40 -04:00
Jeffrey Walton 3657f8c235
Add cryptest-results.txt to clean rule 2018-07-28 09:31:41 -04:00
Jeffrey Walton ef5a3d3905
Add autotools-clean and cmake-clean rules to GNUmakefile 2018-07-28 09:21:31 -04:00
Jeffrey Walton a0ad5e815c
Remove -marm from aes-armv4.S flags 2018-07-27 22:00:28 -04:00
Jeffrey Walton 5861d9342d
Split regtest2.cpp into two files
Rename regtest3.cpp to regtest4.cpp. Split regtest2.cpp into regtest2.cpp and regtest3.cpp
2018-07-27 18:16:25 -04:00
Jeffrey Walton 1f914feaf9
Split bench1.cpp into two files
Renamed bench2.cpp to bench3.cpp. Split bench1.cpp into bench1.cpp and bench2.cpp
2018-07-27 14:13:58 -04:00
Jeffrey Walton e50a40ec59
Fix 'make sources' recipe 2018-07-25 00:11:09 -04:00
Jeffrey Walton baff390f28
Fix older Solaris and SunCC compile
Found during testing on OpenCSW compile farm on Solaris 9 (host unstable9s)
2018-07-21 06:15:40 -04:00
Jeffrey Walton ca302c952e
Fix Solaris 11/Sparc crash in SHA-384 (GH #689, GH #403)
I believe Andrew Marlow first reported it. At the time we could not get our hands on hardware to fully test things. Instead we were using -xmemalign=4i option as a band-aide to avoid running afoul of the Sparc instruction that moves 64-bits of data in one shot.
2018-07-20 13:24:04 -04:00
Jeffrey Walton ee8c141d3c
Fix xompile on downlevel assemblers
This surfaced on Solaris with an ancient Binutils
2018-07-16 15:27:25 -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 26ae1fb7e9
Fix ARM compile for sm4-simd.cpp 2018-07-13 10:39:08 -04:00
Jeffrey Walton 3c21233440
Add AES-NI accelerated SM4 encryption (GH #540)
Thanks to Markku-Juhani Olavi Saarinen for the code. Also see https://github.com/mjosaarinen/sm4ni
2018-07-13 08:33:13 -04:00
Jeffrey Walton 3ff7d7f028
Add ARM AES asm implementation from Cryptogams (GH #683) 2018-07-11 06:59:44 -04:00
Jeffrey Walton 86773e942c
Make GNUmakefile aware of *.S files 2018-07-09 06:19:58 -04:00
Jeffrey Walton 6d1bb00b05
Update Makefile DLLSRCS to include latest files 2018-07-06 22:10:11 -04:00
Jeffrey Walton e6f87274c1
Update Makefile DLLSRCS to include latest files 2018-07-06 21:54:55 -04:00
Jeffrey Walton c73b471dec
Fix CHAM compile on ARMv7 2018-07-04 06:48:54 -04:00
Jeffrey Walton 08e6137082
Add SIMECK-64 SSSE3 implementation (GH #675) 2018-07-01 03:11:00 -04:00
Jeffrey Walton 9980d30734
Add LEA-128 NEON and ARMv8 implementation (GH #669)
LEA-128(128) from 35.6 cpb to 14.11 cpb on a LeMaker HiKey dev-board. LEA-128 from 12.60 cpb to 11.89 cpb on AMD Opteron 1100.
2018-06-23 03:54:51 -04:00
Jeffrey Walton fa7714f6cb
Add LEA-128 SSSE3 implementation (GH #669)
LEA-128(128) from 6.73 cpb to 2.84 cpb on modern Core-i5 6400. LEA-128 from 10.12 cpb to 7.84 cpb antique Core2 Duo.
2018-06-22 16:26:27 -04:00
Jeffrey Walton 6138829572
Add CHAM128 SSSE3 implementation (PR #670)
CHAM-128(128) from 10.5 cpb to 4.1 cpb. CHAM-128(256) from 12.5 cpb to 4.7 cpb.
2018-06-19 18:03:28 -04:00
Jeffrey Walton a07a0e5e5f
Add recipe to install the library only (GH #653)
Some distros don't want to install cryptest.exe. For folks who don't want to install the test program, they can issue 'make install-lib'.
install-lib is a non-standard target, but the GNU Coding Standard does not have a standard target for the task.
2018-05-06 00:10:38 -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
Nicolas Chauvet (kwizart) b6fec08da1 Freeze ABI compatibility with LIB_MAJOR (#589)
This is a convention that binary compatibity uses one number.
Using that, it's possible to have bugfixes releases (patchlevel
incremented) and enhancement release (minor incremented with no
public interface removed).

Here is more information about convention
https://autotools.io/libtool/version.html
(libtool isn't relevant to this project, but the explanation hold)

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2018-02-20 10:05:52 -05:00
Jeffrey Walton e416b243d3
Re-add Simon and Speck, enable SSE (GH #585)
This commit re-adds Simon and Speck. The commit includes C++, SSSE3 and SSE4. NEON, Aarch32 and Aarch64 are disabled at the moment.
2018-02-18 23:23:50 -05:00
Jeffrey Walton 15b14cc618
Remove Simon and Speck ciphers (GH #585)
We recently learned our Simon and Speck implementation was wrong. The removal will stop harm until we can loop back and fix the issue.
The issue is, the paper, the test vectors and the ref-impl do not align. Each produces slightly different result. We followed the test vectors but they turned out to be wrong for the ciphers.
We have one kernel test vector but we don't have a working implementation to observe it to fix our implementation. Ugh...
2018-02-14 04:06:16 -05:00
Jeffrey Walton d5161923cb
Use INSTALL_PROGRAM for shared objects (GH #582) 2018-02-05 09:03:21 -05:00
Jeffrey Walton 0a43341cec
Use install program for Makefile (GH #582) 2018-02-05 08:54:13 -05:00
Jeffrey Walton 96bc82fe12
Avoid a compiler warning in Makefile tests 2018-01-28 20:23:48 -05:00
Jeffrey Walton 51ce834cc4
Fix ARM detection (GH #573) 2018-01-28 13:33:03 -05:00
Jeffrey Walton 69d5400b3f
Fix MinGW misdetection (GH #573)
This commit does a few things. First, it uses the compiler's triplet and the build component to determine the machine we are targeting. Second, it adds an 'X' prefix so we don't collide with someone else's variables. Third it cleans up some of the recipes. Fourth, it removes X32 detection since the system differences are handled in config.h and the source files
2018-01-27 13:05:23 -05:00
Jeffrey Walton c16eddb40e
Use /bin/sh (GH #573) 2018-01-25 18:39:24 -05:00
XU Cheng 0bec012333 Fix building for Linuxbrew (#575)
Linuxbrew is a fork of Homebrew on Linux.
In which, the `gcc --version` will report "homebrew".
Therefore, the current code will incorrectly set OSXPORT_COMPILER
under such environment, which results to the following compiling errors:

gcm.cpp:823: Error: too many memory references for `add'
gcm.cpp:824: Error: too many memory references for `pxor'
gcm.cpp:825: Error: ambiguous operand size for `shr'
gcm.cpp:826: Error: too many memory references for `movzx'
gcm.cpp:827: Error: too many memory references for `add'
gcm.cpp:828: Error: too many memory references for `pxor'
gcm.cpp:829: Error: too many memory references for `movzx'
gcm.cpp:830: Error: too many memory references for `add'
gcm.cpp:831: Error: too many memory references for `pxor'
gcm.cpp:832: Error: ambiguous operand size for `add'
gcm.cpp:833: Error: ambiguous operand size for `sub'
gcm.cpp:835: Error: too many memory references for `movdqa'
g++-5 -DNDEBUG -g2 -O3 -fPIC -Wa,-q -DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER=1 -pthread -pipe -c md4.cpp
make: *** [GNUmakefile:1120: gcm.o] Error 1
make: *** Waiting for unfinished jobs....

Fix this problem by checking IS_DARWIN before setting OSXPORT_COMPILER.
2018-01-25 09:17:54 -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 fb0ecfde62
Clear clang-tidy warnings
This commit also tweaks the way Integer parses byte arrays. The modified routines are slightly faster. On a Core-i5 6400 the self tests are 0.1 to 0.2 seconds faster
2018-01-02 04:17:22 -05:00
Jeffrey Walton 1a7f19cdde
Use 'command -v' to test for ld.gold 2018-01-02 01:13:59 -05:00
Jeffrey Walton 651563e6c2
Temporary fix for IBM XLC failed SM3 self tests (GH #553) 2017-12-30 22:18:08 -05:00
Jeffrey Walton 8b7f21b07d
Update makefiles to use one call to $(CXX) -dumpmachine 2017-12-30 18:38:40 -05:00
Jeffrey Walton cd35346f70
Fix Solaris failed compile due to SHA with GCC (GH #551) 2017-12-28 19:14:20 -05:00