Commit Graph

205 Commits (eb3b27a6a5432b21e8e0bb2abb364096b2dca41e)

Author SHA1 Message Date
Jeffrey Walton eb3b27a6a5
Clear Visual Studio warnings (Issue 412) 2017-05-30 16:37:41 -04:00
Jeffrey Walton f40c55810d
Add method for sanitizer suppression 2017-05-21 21:51:31 -04:00
Jeffrey Walton 5f0cbde980
Removed MSVC warning suppression for many warnings (Issue 412)
Most of these appear to have been cleared over the last couple of years.

C4127 is too prevelant. We are probably going to have to live with it.

We may be able to clear C4250 with a using statement. For example 'using ASN1CryptoMaterial::Load'.

MSVC resisted clearing C4661 by pushing/poping in iterhash.h and osrng.h. It was like MSVC simply ignored it.
2017-05-16 03:52:03 -04:00
Jeffrey Walton 0611e11507
Disable word128 for PPC64 and GCC 4.8 (Issue 421) 2017-05-12 23:51:27 -04:00
Jeffrey Walton 554b7a2747
Fix "error: inlining failed ... target specific option mismatch (Issue 407) 2017-05-01 17:54:05 -04:00
Jeffrey Walton 8ded8bc38d
Clear SunCC anachronism warning "Attempt to redefine IS_BIG_ENDIAN without using #undef" 2017-04-21 23:52:43 -04:00
Jeffrey Walton 65c3c63b52
Breakout and cleanup macros. Add CRYPTOPP_ENABLE_ARIA_SSE2_INTRINSICS, CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS and CRYPTOPP_ENABLE_ARIA_NEON_INTRINSICS.
Tune CRYPTOPP_ENABLE_ARIA_SSE2_INTRINSICS and CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS macro for older GCC and Clang. Clang needs some more tuning on Aarch64 becuase performance is off by about 15%.

Add additional NEON code paths.

Remove keyBits from Aarch64 code paths.
2017-04-13 17:45:58 -04:00
Jeffrey Walton 35f95fb739
Fix unaligned pointer crash on Win32 due to _mm_load_si128
The SSSE3 intrinsics were performing aligned loads using _mm_load_si128 using user supplied pointers. The pointers are only a byte pointer, so its alignment can drop to 1 or 2. Switching to _mm_loadu_si128 will sidestep potential problems. The crash surfaced under Win32 testing.

Switch to memcpy's when performing bulk assignment x[0]=y[0] ... x[3]=y[3]. I believe Yun used the pattern to promote vectorization. Some compilers appear to be braindead and issue integer move's one word at a time. Non-braindead compiler will still take the optimization when advantageous, and slower compilers will benefit from the bulk move. We also cherry picked vectorization opportunities, like in ARIA_GSRK_NEON.

Remove keyBits variable. We now use UncheckedSetKey's keylen throughout.

Also fix a typo in CRYPTOPP_BOOL_SSSE3_INTRINSICS_AVAILABLE. __SSSE3__ was listed twice.
2017-04-13 04:28:02 -04:00
Jeffrey Walton 59767be52e
Add Intel and ARM intrinsics
Win32 and Win64 benefited from the Intel intrinsics. A32 and Aarch64 benefited from the ARM intrinsics. The intrinsics shaved 150 to 350 cycles from key setup.

The intrinsics slowed modern GCC down a small bit, and did not appear to affect old GCC. As such, Intel intrinsics were only enabled for Microsoft compilers.

We were not able to improve encryption and decryption. In fact, some of the attempted macro conversions and intrinsics attempts slowed things down considerably. For example, GCC 5.4 on x86_64 went from 120 MB/s to about 70 MB/s when we tried to improve code around the Key XOR Layer (ARIA_KXL).
2017-04-12 23:28:41 -04:00
Jeffrey Walton c305e88127
Fix runtime crash when CRYPTOPP_INIT_PRIORITY=0
Couple use of initialization priorities to no NO_OS_DEPENDENCE
Add comments explaining what integer does, how it does it, and why we want to inprove on the Singleton pattern as a resource manager.
Update documentation.
2017-03-27 06:06:12 -04:00
Jeffrey Walton 0e55f5ac7d
Remove g_pAssignIntToInteger pointer, add CRYPTOPP_NO_ASSIGN_TO_INTEGER (Issue 389)
This effectively decouples Integer and Public Key from the rest of the library. The change means a compile time define is used rather than a runtime pointer. It avoids the race with Issue 389.
The Public Key algorithms will fail if you use them. For example, running the self tests with CRYPTOPP_NO_ASSIGN_TO_INTEGER in effect results in "CryptoPP::Exception caught: NameValuePairs: type mismatch for 'EquivalentTo', stored 'i', trying to retrieve 'N8CryptoPP7IntegerE'". The exception is expected, and the same happend when g_pAssignIntToInteger was present.
2017-03-25 16:38:42 -04:00
Jeffrey Walton f502ee9218
Simplify C++ dynamic object initialization
Wrap DetectArmFeatures and DetectX86Features in InitializeCpu class
Use init_priority for InitializeCpu
Remove HAVE_GCC_CONSTRUCTOR1 and HAVE_GCC_CONSTRUCTOR0
Use init_seg(<name>) on Windows and explicitly insert at XCU segment
Simplify logic for HAVE_GAS
Remove special recipies for MACPORTS_GCC_COMPILER
Move C++ static initializers into anonymous namespace when possible
Add default NullNameValuePairs ctor for Clang
2017-03-20 08:51:10 -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 46c9cc725c
Use C++03 Singleton on select Microsoft platforms (Issues 372, 373, 389, 391)
We are back to the "... one object may end up being memory leaked" if faced with concurrent initialization
2017-03-15 06:20:45 -04:00
Jeffrey Walton a0bb490056
Define _XOPEN_SOURCE for Cygwin/Newlib (Issue 315) 2017-03-10 01:53:51 -05:00
Jeffrey Walton 5efb019d8b
Add C++ nullptr support (Issue 383) 2017-03-01 06:10:06 -05:00
Jeffrey Walton 62f92dd592
Change next version from 5.7 to 6.0
Crypto++ 5.7 was the increment after the 5.6.5 release. Crypto++ 6.0 accurately reflects compatibility
2017-02-21 12:59:20 -05:00
anonimal 8558bc519c
config.h: add DragonFly BSD support 2017-02-19 07:04:38 +00:00
Jeffrey Walton 81b1a18063
Change file preamble to include "originally written by Wei Dai"
We have made a fair number of changes, and we don't want WD to receive credit for issues he was not part of
2017-01-27 07:05:45 -05:00
Jeffrey Walton 79f3ab89f1
Removed remaining CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY (Issue 369) 2017-01-27 06:02:58 -05:00
Jeffrey Walton b129818c35
Add GCC inline ASM for PMULL and PMULL2
The macros that invoke GCC inline ASM have better code generation and speedup GCM ops by about 70 MiB/s on an Opteron 1100. The intrinsics are still available for Windows platforms and Visual Studio 2017 and above
2017-01-19 02:38:00 -05:00
Jeffrey Walton 8eb1b6cb6b
Update CRYPTOPP_BOOL_ARM_PMULL_INTRINSICS_AVAILABLE availability (Issue 362)
PMULL and PMULL2 are available on Aarch64 only, and not Aarch32 or A-32
2017-01-16 05:35:53 -05:00
Jeffrey Walton c80502102a
Breakout __ARM_FEATURE_CRYPTO into PMULL, AES and SHA for Apple Clang (Issue 362)
It appears Apple Clang disgorges carryless multiply (PMULL) from Crypto (AES and SHA). The breakout added CRYPTOPP_BOOL_ARM_PMULL_INTRINSICS_AVAILABLE for PMULL, and retained CRYPTOPP_BOOL_ARM_CRYPTO_INTRINSICS_AVAILABLE for AES and SHA only
2017-01-15 00:22:14 -05:00
Jeffrey Walton 732601e8b6
Microsoft still does not suport ARMv8 and the ARM intrinscs
Remove the define for now. Maybe Microsoft will support it in 2019 or 2020
2017-01-13 23:57:11 -05:00
klemens 5a5c633073 spelling fixes 2016-12-27 18:34:57 +01:00
Jeffrey Walton 1a17ade299
Fixed version numbers
Version numbers are rolled back to update the docs. The rolled back versions got committed with the updated docs
2016-12-11 07:06:38 -05:00
Jeffrey Walton 99ae937d8b
Updated documentation (Issue 121) 2016-12-11 06:56:52 -05:00
Jeffrey Walton d01467b754
Use 'static const int' for constants in Doxygen documentation (Issue 343) 2016-12-04 16:07:10 -05:00
Jeffrey Walton d45763a7ae
Removed CRYPTOPP_DISABLE_X86ASM macro (Issue 70) 2016-12-03 05:16:23 -05:00
Jeffrey Walton ba75834ae9
Removed VC++ 5.0 and 6.0 workarounds (Issue 342) 2016-12-03 05:05:56 -05:00
Jeffrey Walton 40230dd3bf
Removed MAINTAIN_BACKWARDS_COMPATIBILITY_562 (Issue 70) 2016-12-03 00:32:07 -05:00
Jeffrey Walton c8b910aff5
Backed-off automatically setting CRYPTOPP_BOOL_SSE_SHA_INTRINSICS_AVAILABLE due to bad interaction with '-march=x86-64'. Disgorge SSE2 implementation from CXX implementation 2016-12-01 23:35:13 -05:00
Jeffrey Walton 82009ecf41
Increment version to 5.7 due to ABI break *Issue 337)
We still need to supply a patch for those maintaining 5.6.x
2016-12-01 18:10:56 -05:00
Jeffrey Walton 70d7297559 Merge pull request #339 from ralphtandetzky/master
Fix: GCC warning "type qualifiers ignored on function return type".
2016-12-01 09:56:39 -05:00
Ralph Tandetzky 35a2ef10a2 Fix: GCC warning "type qualifiers ignored on function return type".
This pedantic message appeared all over the code. Also removed one warning about an unused variable in release build.
2016-12-01 15:37:04 +01:00
Jeffrey Walton 7ab9b00f90
Add Intel SHA1 extension support 2016-12-01 00:49:59 -05:00
Jeffrey Walton 2b736bc6f1
Fix "deprecated conversion from string constant to ‘char*’" 2016-11-14 19:45:08 -05:00
Jeffrey Walton 76b11b010c
Add CRYPTOPP_STATIC_CONSTEXPR macro 2016-11-13 11:50:34 -05:00
Jeffrey Walton 61aa62bd8f
Add CRYPTOPP_STATIC_CONSTEXPR 2016-11-12 09:34:34 -05:00
Jeffrey Walton aa8260df2c
Use enum for Doxygen processing 2016-11-10 02:04:46 -05:00
Jeffrey Walton 84b602cc7d
Fix compile under Debian Hurd (i386)
Debian Hurd defines __MACH__, and it was picking up "#define CRYPTOPP_SECTION_INIT __attribute__((section (__DATA,__data)))" intended for Apple linkers
2016-10-28 00:33:43 -04:00
Jeffrey Walton 69de0d591b
Fix "operator '>=' has no left operand" (Issue 329) 2016-10-27 14:20:51 -04:00
Jeffrey Walton 5596f73371
Fix Cygwin Newlib signal handler (Issue 315) 2016-10-14 15:00:49 -04:00
Jeffrey Walton 4d562aaac7
Post-release version increment 2016-10-11 14:37:03 -04:00
Jeffrey Walton e09d8a2491
Fix Cygwin compile due to missing <signal.h> 2016-10-01 22:12:08 -04:00
Jeffrey Walton 2efedfb5ab
Reset config.h that cross-pollinated from AES dev-branch 2016-09-30 01:19:44 -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 e0651b458f Fix Visual Studio 2005 compile (Part of Issue 300) 2016-09-22 23:54:10 -04:00
Jeffrey Walton 06e29357cb config.compat
Fix MSC compile under ARM
2016-09-21 02:02:55 -04:00
Jeffrey Walton 32ae3e52f1 Partially revert 714daaf570.
We were mostly OK under i686/x86_64, but Clang died completely under ARM-32 and Aarch64.
2016-09-21 00:35:59 -04:00