Commit Graph

4352 Commits (39aaec7c5992f68cbbd984ef90da735f81099ad0)

Author SHA1 Message Date
Jeffrey Walton 28e7baf46b
Clear C4456 under MSVC 2018-11-09 09:26:09 -05:00
Jeffrey Walton a75f0cd855
Fix missing comment characters 2018-11-09 08:38:29 -05:00
Jeffrey Walton 092309b266
Fix global optimization bug for ChaCha AVX2 under VS2017 (GH #735)
Also see https://github.com/weidai11/cryptopp/issues/649. The 649 issue is the one affecting AES. It appears to be the same problem.
2018-11-09 08:00:53 -05:00
Jeffrey Walton af9fb9d21e
Add ChaCha to self tests (GH #732) 2018-11-08 22:08:59 -05:00
Jeffrey Walton e6112e35df
Clear C4456 under MSVC 2018-11-08 21:31:25 -05:00
Jeffrey Walton dede7bf6b4
Whitespace check-in 2018-11-08 20:34:22 -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 9b31bc189c
Fix Solaris hardware cpas to allow AVX and AVX2 2018-11-08 15:38:13 -05:00
Jeffrey Walton cc5eb3919f
Fix compile using SunCC 5.9 2018-11-08 15:08:30 -05:00
Jeffrey Walton 4ddaa9d01d whitespace check-in 2018-11-07 13:18:37 -05:00
Jeffrey Walton f57df06c5e
Disable global optimizations for Rijndael using MSC compiler (GH #649) 2018-11-05 23:45:59 -05:00
Jeffrey Walton 5a36cd54bd
Add meaningful test failure messages 2018-11-05 21:26:16 -05:00
Jeffrey Walton 8b13c2a8d0
Whitespace check-in
Look, we can finally use whitespace to add breaks and make these somewhat readable.
2018-11-05 20:43:11 -05:00
Jeffrey Walton 93c7518900
Improve datatest parser
This switches to line oriented parsing for the test files. Previously we we using streams for names, and lines for values. We can now use whitespace and make the tests a bit more readable by grouping similar tests. AlgorithmType will clear the current accumlated values.
2018-11-05 20:40:39 -05:00
Jeffrey Walton 7c0be4ea8f
Add additional Salsa test vectors 2018-11-05 09:00:32 -05:00
Jeffrey Walton 5de6545827
Add additional test vectors 2018-11-04 20:05:08 -05:00
Jeffrey Walton 4ee0b3e2f6
cryptlib.h 2018-11-04 15:46:44 -05:00
Jeffrey Walton f5bce1ab8c
Fix missing errno on PPC64 with GCC 4.8.5 2018-11-04 15:36:13 -05:00
Jeffrey Walton 6cc763939e
Skip unneeded wrap check in SIMD book keeping (GH #732) 2018-11-04 15:35:34 -05:00
Jeffrey Walton 29be6ed97a
Work-around potential counter increment problem in ChaCha20 (GH #732)
This is only a work-around for the moment. The issue only affects SIMD code. The problem is, the algorithm we use performs a 32-bit add as an intermediate result, but we really need a 64-bit add. We are running 4 transforms in parallel, and we can't add and carry the way we need to.

The workaround is, whenever we could cross the 32-bit counter boundary we use the C version of the transform. We determine the cross-over point by 'bool safe = 0xffffffff - state.low > 4'. When not safe we skip the SIMD version of the algorithm and use the C version. Once we are safe again we use the SIMD version again.

The work-around costs us about 0.1 to 0.2 cpb. At 1.10 or 1.15 cpb that equates to about 200 MB/s on a Skylake. We'd like to get it back eventually.
2018-11-04 14:49:26 -05:00
Jeffrey Walton d7a3562c0b
Whitespace check-in 2018-11-04 14:36:55 -05:00
Jeffrey Walton 87d679bc7e
Add additional ChaCha20 test vectors (GH #732)
The additional tests ensure we cross the 32-bit boundary used by the state counters
2018-11-04 14:34:32 -05:00
Jeffrey Walton 40fa6873f9
Add ability to Seek64 in test framework (GH #732)
Also see https://github.com/randombit/botan/pull/1728
2018-11-04 14:21:54 -05:00
Jeffrey Walton f7c0fab5b2
Fix compile on early Apple platforms.
I think this may be related to the VectorSource check-in. The error is:

algparam.h: In constructor 'ConstByteArrayParameter::ConstByteArrayParameter(const T&, bool) [with T = std::vector<byte, std::allocator<byte> >]':
filters.h:1444:   instantiated from here
algparam.h:56: error: 'const class std::vector<byte, std::allocator<byte> >' has no member named 'data'
2018-11-03 20:00:29 -04:00
Jeffrey Walton a4d97e9bf8
Use vec_shleft_octet to avoid confusion with vec_extract 2018-11-03 19:29:08 -04:00
Jeffrey Walton 4e3d160acc
Update comments 2018-11-03 18:56:59 -04:00
Jeffrey Walton 43cf1f0d95
Use vec_sldo to avoid confusion with vec_extract 2018-11-03 17:34:36 -04:00
Jeffrey Walton aee045912a
Whitespace check-in 2018-11-03 16:42:35 -04:00
Jeffrey Walton 6aa6393bf3
Update documentation 2018-11-03 11:17:54 -04:00
Jeffrey Walton 4b4dbdb90a
Update documentation 2018-11-03 11:09:09 -04:00
Jeffrey Walton bdeaae3ac9
Fix disjoint t[] and f[] when using SIMD implementations 2018-11-03 10:49:22 -04:00
Jeffrey Walton 600e2a8be4
Rewrite BLAKE2 classes to remove intermediate base class 2018-11-03 10:33:35 -04:00
Jeffrey Walton 06867e5caf
Guard BLAKE2 on CRYPTOPP_ALTIVEC_AVAILABLE 2018-11-03 05:50:34 -04:00
Jeffrey Walton dfacc9f15c
Use CRYPTOPP_ALTIVEC_AVAILABLE values over defined
This allows users to -DCRYPTOPP_ALTIVEC_AVAILABLE=0 on the command line. It is especially important on PPC, which varies wildly among compilers dating back to the 2000's
2018-11-03 05:25:52 -04:00
Jeffrey Walton aa7e90903e
Remove unneeded #undef's from BLAKE2_Compress32_POWER7 2018-11-02 21:24:55 -04:00
Jeffrey Walton d68d01066f
Cleanup return statements in PowerPC's VectorSet32 2018-11-02 21:23:41 -04:00
Jeffrey Walton fc17f160ac
Remove unneeded BLAKE2B_IV from Blake2s source file 2018-11-02 19:21:57 -04: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 d2b64a4d63
Add BLAKE2b Power8 implementation (GH #731) 2018-11-02 18:34:46 -04:00
Jeffrey Walton 1fd8ac8b8b
Use vec_perm on PowerPC little-endian for GCC 2018-11-01 14:05:34 -04:00
Jeffrey Walton c6d2729954
Update comments 2018-11-01 13:32:42 -04:00
Jeffrey Walton bcfd8444e5
Use vec_mergeh and vec_mergel for PowerPC
Origian benchmarks showed no material difference. However, today we are seeing up to 0.4 cpb profit on GCC112.
2018-11-01 13:07:49 -04:00
orangefour 20f82c067e Add VectorSource (GH #730) 2018-11-01 06:49:04 -04:00
Jeffrey Walton 7c5da3e1ca
Update comments 2018-10-31 02:42:25 -04:00
Jeffrey Walton a19385a684
Fix mask names
This follows IBM convention, where the lowest memory address is "high", and the highest memory address is "low"
2018-10-30 19:35:16 -04:00
Jeffrey Walton 95d454841c
Update documentation 2018-10-30 09:42:42 -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 ffe63caae5
Add CXX awareness to CMake test script 2018-10-29 04:58:32 -04:00