Commit Graph

227 Commits

Author SHA1 Message Date
Jeffrey Walton
92808945c1
Fix TestAltivecOps on AIX 2019-01-20 19:34:09 -05:00
Jeffrey Walton
f6e04e5f33
Rename PPC vector functions from VectorFunc to VecFunc 2018-11-15 15:17:49 -05:00
Jeffrey Walton
3c7bdf1a26
Add Octet suffix for vec_sld
We need to make room for packed shifts and rotates
2018-11-14 23:32:26 -05:00
Jeffrey Walton
505c58acc1
Add Octet suffix for vec_sld
We need to make room for packed shifts and rotates
2018-11-14 23:12:39 -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
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
04306f86ac
Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools 2018-10-27 07:30:15 -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
5b89e774cc Add Altivec vector extraction tests 2018-08-09 00:06:42 -04:00
Jeffrey Walton
13b6dac31d
Remove temporary variable 2018-08-08 21:48:07 -04:00
Jeffrey Walton
bcf05a6c6b
Add additional PowerPC self tests 2018-08-08 20:52:50 -04:00
Jeffrey Walton
4c30f57d1b
Update comments 2018-08-06 23:04:10 -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
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
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
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
517d552a91
Add ARMv7 cpu detection 2018-07-08 02:49:21 -04:00
Jeffrey Walton
989bf6dc5e
Add HC-256 stream cipher (GH #680) 2018-07-05 06:43:04 -04:00
Jeffrey Walton
dd31eb80c0
Add HC-128 stream cipher (GH #679) 2018-07-05 00:29:07 -04:00
Jeffrey Walton
d00777e1d7
Add Rabbit stream cipher (GH #678) 2018-07-04 03:47:28 -04:00
Jeffrey Walton
61f635b837
Add additional SIMECK tests (GH #675) 2018-06-30 08:25:32 -04:00
Jeffrey Walton
2f5b110b52
Add HIGHT lightweight block cipher (GH #672) 2018-06-24 00:54:16 -04:00
Jeffrey Walton
55ba5de9b5
Fix typo 2018-06-18 19:00:30 -04:00
Jeffrey Walton
0ccdc197b7
Add AVX and AVX2 runtime feature detection (GH #671)
There are no corresponding defines in config.h at the moment. Programs will have to use the preprocessor macros __AVX__ and __AVX2__ to determine when they are available.
2018-06-18 18:33:17 -04:00
Jeffrey Walton
54d5100344
Add CHAM lightweight block cipher (PR #670)
Add CHAM lightweight block cipher
2018-06-17 23:24:47 -04:00
Jeffrey Walton
1f06c512c4
Add LEA lightweight block cipher (GH #669) 2018-06-17 22:36:41 -04:00
Jeffrey Walton
64d02e3a18
Add scrypt key derivation function (GH #613, PR #626) 2018-03-31 20:09:38 -04:00
Jeffrey Walton
8c5abe604a
Remove '#undef BLOCKING_RNG_AVAILABLE' from validate.cpp
This was for testing on low-resource ARM dev-boards. It accidentally cross-pollinated into other systems.
2018-03-28 13:06:16 -04:00
Jeffrey Walton
eb0d040786
Move some tests from TestIntegerBitops to TestIntegerOps (GH #602) 2018-03-25 00:58:11 -04: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
5c5d3e4c26
Clear Coverity finding CID 186948
"Logically dead code"
2018-01-19 18:35:23 -05:00
Jeffrey Walton
58b6999274
Convert Kalyna from variable block size (GH #535) 2018-01-18 20:26:10 -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
23f3328948
Add additional Encoder and Decoder alphabet test (GH #562) 2018-01-13 09:01:18 -05:00
Jeffrey Walton
73b08a82f2
Fix lookup array size in self test 2018-01-12 19:37:05 -05:00
Jeffrey Walton
29a15f6342
Add additional Encoder and Decoder alphabet test (GH #562) 2018-01-12 19:20:32 -05:00
Jeffrey Walton
746fd6a648
add self test for custom Encoder and Decoder alphabet (GH #562) 2018-01-12 18:59:48 -05:00
Linmao Song
1823b9d9c4 Fix error in bits2octets: should use the base point's bit count, instead of the hash value's. Also add test case for GetRandom, with original data from RFC6979 (#560) 2018-01-10 20:18:15 -05:00
Jeffrey Walton
58726498f1
Clear clang-tidy warnings 2018-01-02 00:15:34 -05:00
Jeffrey Walton
e85b388234
Add thorough param to ValidateECGDSA 2017-11-25 03:27:07 -05:00
Jeffrey Walton
5267723a49
Add SM3 hash function (GH #541) 2017-11-23 23:19:09 -05:00
Jeffrey Walton
3970a066e3
Add SIMON-64 and SIMON-128 lightweight block ciphers (GH #539) 2017-11-21 04:58:51 -05:00
Jeffrey Walton
b9fc470bc7
Add SPECK-64 and SPECK-128 lightweight block ciphers (GH #538) 2017-11-20 06:30:21 -05:00
Jeffrey Walton
69c8a4f9c6
Prefix IS_LITTLE_ENDIAN and IS_BIG_ENDIAN with CRYPTOPP 2017-11-10 14:15:30 -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
3bd01f73ba
Add Power8 SHA256 and SHA512 support (GH #513) 2017-09-22 08:58:50 -04:00
Jeffrey Walton
205ebe0871
Add missing newline to IA-32 config output
Avoid flushing stream for config line items
Use memcpy in std:: namespace
2017-09-16 01:36:45 -04:00
Jeffrey Walton
fb78afba29
Add PowerPC support to cpu.h and validate.cpp 2017-09-11 03:05:04 -04:00
Jeffrey Walton
b6f79af343
Clear GCC warnings with -Wall -Wextra 2017-09-05 18:03:46 -04:00