Commit Graph

83 Commits (a9fd2b6104eb6d7cac1a4b33c9f751e016e4f3c0)

Author SHA1 Message Date
Jeffrey Walton c44f32d683 Sync with upstream master 2017-08-14 02:22:48 -04:00
Jeffrey Walton 2aff92ddb6
Fix bad SHA::Transform calculation (Issue 455)
Reworked SHA class internals to align all the implementations. Formerly all hashes were software based, IterHashBase handled endian conversions, IterHashBase repeatedly called the single block SHA{N}::Transform. The rework added SHA{N}::HashMultipleBlocks, and the SHA classes attempt to always use it.

Now SHA{N}::Transform calls into SHA{N}_HashMultipleBlocks, which is a free standing function. An added wrinkle is hardware wants little endian data and software presents big endian data, so HashMultipleBlocks accepts a ByteOrder for the incoming data. Hardware based SHA{N}_HashMultipleBlocks can often perform the endian swap much easier by setting an EPI mask so it was profitable to defer to hardware when available.

The rework also removed the hacked-in pointers to implementations. The class now looks more like AES, GCM, etc.
2017-08-13 16:05:39 -04:00
Jeffrey Walton 011429583d
Fix sources after sync with upstream master 2017-08-13 07:06:19 -04:00
Jeffrey Walton e0ec92b541 Sync with Upstream master 2017-08-13 06:54:28 -04:00
Jeffrey Walton 863bf9133c
Cleanup casts due to Clang 2017-08-13 06:32:09 -04:00
Jeffrey Walton 22b7d74e1f
Test Apple ARM64 runtime detection
This is a compile test
2017-08-11 11:57:30 -04:00
Jeffrey Walton f7978a6529
Sync with Upstream master 2017-08-11 07:53:37 -04:00
Jeffrey Walton 28a1fc2c60 Sync with Upstream master 2017-08-11 07:36:27 -04:00
Jeffrey Walton 173dd0b530
Add AES for ARMv8 (Issue 458) 2017-08-11 07:31:09 -04:00
Jeffrey Walton 0b8d6465bd
Use consistent naming of <class>_<inner class>_<func>_<arch> 2017-08-08 19:10:56 -04:00
Jeffrey Walton 1459042324
Fix ARMv8 AES Decryption
AES ECB and CTR mode encryption is running about 2.8 to 3.0 cpb.
Hallelujah, its a wrap.
2017-08-06 22:57:02 -04:00
Jeffrey Walton 701ec3aa1f
Fix ARMv8 AES Encryption
ARMv8 AES decryption is not working at the moment. This check-in will allow us to test the current changes more widespread. We expected AES decryption failures only
2017-08-06 21:25:36 -04:00
Jeffrey Walton b9ab0579d3
Fix Clang compile 2017-08-01 05:55:06 -04:00
Jeffrey Walton 1356456f05
Finish AESNI cut-in
Remove specialized MMX and ISSE support. SSE2 is now the floor
2017-08-01 01:20:30 -04:00
Jeffrey Walton 142fe88ae1
Initial AES cleanup after cross-platofrm testing 2017-07-31 23:17:18 -04:00
Jeffrey Walton a495018af2
Fix GCM under SSSE3 and CLMUL 2017-07-31 00:40:03 -04:00
Jeffrey Walton 5e9e228727
Fix ARIA under SSSE3 2017-07-30 22:55:50 -04:00
Jeffrey Walton fe9e21ddd7
Cut-in CRC test for SSE4.2 and ARMv8a
Also see https://groups.google.com/forum/#!topic/cryptopp-users/-1fZCx8JSRE
2017-07-29 00:24:07 -04:00
Jeffrey Walton 301437e693
Updated static initializers
When MSVC init_seg or GCC init_priority is available, we don't need to use the Singleton. We only need to create a file scope class variable and place it in the segment for MSVC or provide the attribute for GCC.
An additional upside is we cleared all the memory leaks that used to be reported by MSVC for debug builds.
2017-03-17 20:47:32 -04:00
Jeffrey Walton 5efb019d8b
Add C++ nullptr support (Issue 383) 2017-03-01 06:10:06 -05:00
Jeffrey Walton 733a073d65
Fix mismatched arch capabilities (Issue 283) 2016-10-27 01:01:01 -04:00
Jeffrey Walton 19ebf769e7
Add debug instrumentation to Rijndael
We added asserts due to Coverity findings. We beieve the findings were false positives
2016-09-30 13:14:29 -04:00
Jeffrey Walton 2b328e8f8b
Fix AES and X86 compile on Solaris 2016-09-30 09:31:23 -04:00
Jeffrey Walton 4c1b5472cc Cutover to SecByteBlock member for AES (Issue 302, CVE-2016-7544) 2016-09-30 01:09:21 -04:00
Jeffrey Walton bfd23861f4 Whitespace cleanup 2016-09-24 18:59:55 -04:00
John Byrd a33b95325f When calculating the AES block cipher, allocate 4K of memory on the stack instead of 256+ bytes. Search within that 4K space to put the 256-byte aligned Locals struct in a place which does not have 4K cache conflicts with the Te temporary buffer. This permits us to call _malloca() or alloca() once per call of this function. This commit also makes sure that the Microsoft-only _freea() occurs at the correct location instead of at a pointer to the middle of the stack, when the memory allocated by _malloca() or alloca() is not 256-byte aligned. 2016-09-22 17:43:57 -07:00
Jeffrey Walton 399a1546de Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)
trap.h and CRYPTOPP_ASSERT has existed for over a year in Master. We deferred on the cut-over waiting for a minor version bump (5.7). We have to use it now due to CVE-2016-7420
2016-09-16 11:27:15 -04:00
Jeffrey Walton ada2aa55ed Fix typo on SunCC version 2016-08-26 05:08:57 -04:00
Jeffrey Walton 4fd51eb06c Add vec_swap for compilers which do not support std::swap'ing SSE and NEON types 2016-07-17 21:25:55 -04:00
Jeffrey Walton 1cb906938d Fix SunCC 12.2 and 12.3 failed compile in rijndael.cpp due to std::swap(__m128i, __m128i) 2016-07-16 23:45:16 -04:00
Jeffrey Walton ba2c778f1b Fix typo in SunCC check 2016-07-15 01:53:01 -04:00
Jeffrey Walton b099030c46 Fix broken rijndael.cpp compile under Sun Studio (Issue 224) 2016-07-15 00:40:13 -04:00
Jeffrey Walton c1f025343a Add C++11 alignas support. Deleting 'alignas' branch 2016-06-14 19:14:09 -04:00
Marcel Raad f43b7c95cd Check for SSE4 support before using SSE4.1 instruction
In a 32-bit Windows program compiled with Visual C++ 2013 Update 5, we
sometimes get crashes because of an exception "0xC000001D: Illegal Instruction"
on the pextrd (_mm_extract_epi32) instruction. Explicitly check for SSE4
support instead of only AES-NI before using this SSE4.1 instruction.
2016-05-10 12:43:49 +02:00
Jeffrey Walton 22f493dda9 Fix the Rijndael timing attack counter measure (Issue 146) 2016-04-12 14:43:39 -04:00
Jeffrey Walton 50e5c14c18 Improve constant propagation of fix for Issue 146 2016-04-07 19:20:33 -04:00
Jeffrey Walton ab393851ec Revert "Improve performance of fix to Issue 146"
This reverts commit 5cce8c33ca. It was an incomplete remediation because it was applied to one area of the code, and not both areas of the code. The complete remediation will be checked-in next.
2016-04-07 19:14:11 -04:00
Jeffrey Walton 5cce8c33ca Improve performance of fix to Issue 146 2016-04-07 19:05:30 -04:00
Pierre Lestringant 9f335d719e Fix the Rijndael timing attack counter measure 2016-04-06 15:51:17 +02:00
Jeffrey Walton 823bc93357 Add call for _malloca/_freea. They are SDLC compliance items on Windows platform 2016-02-09 16:37:19 -05:00
Jeffrey Walton b773052b3d Temporary fix for Issue 42 and 132 2016-02-07 04:52:59 -05:00
Jeffrey Walton c8de423ab5 Fix missing CryptoPP::rdtable::Te symbol for Microsoft SSE2 non-AESNI X64 platforms when CRYPTOPP_NO_UNALIGNED_DATA_ACCESS defined 2016-02-06 22:19:53 -05:00
Jeffrey Walton 58ed2fcd37 Removed CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS. No longer necessary 2016-02-05 02:46:26 -05:00
Jeffrey Walton d55d7fe90a Removed garbage charcters suffixed to CRYPTOPP_GENERATE_X64_MASM. They appear to have entered on November 15, 2015 with commit 48809d4e85 2016-02-05 00:27:23 -05:00
Jeffrey Walton ab320ad59b Cleared -Wcast-align (Issue 122) 2016-01-25 22:03:07 -05:00
Jeffrey Walton a44e823c3c Re-constify intermediate void* cast 2016-01-25 19:56:17 -05:00
Jeffrey Walton c76114705c Cleared -Wcast-align (Issue 122). No asserts added because X86/X32/X64 uses unaligned accesses with the compressed tables 2016-01-25 19:30:35 -05:00
Jeffrey Walton 0e3ee98ff6 Fixed Clang 3.4 compiler error on Linux 2015-12-25 08:00:05 -05:00
Jeffrey Walton 6ac1e46a1f Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 (Coverity rollup) 2015-11-18 15:32:28 -05:00
Jeffrey Walton 48809d4e85 CRYPTOPP 5.6.3 RC6 checkin 2015-11-05 01:59:46 -05:00