Commit Graph

41 Commits

Author SHA1 Message Date
Jeffrey Walton
f33b19bf00
Add XOP aware Salsa20 2018-10-25 05:24:02 -04:00
Jeffrey Walton
916c4484a2
Add ChaCha SSE2 implementation
Thanks to Jack Lloyd and Botan for allowing us to use the implementation.
The numbers for SSE2 are very good. When compared with Salsa20 ASM the results are:
  * Salsa20 2.55 cpb; ChaCha/20 2.90 cpb
  * Salsa20/12 1.61 cpb; ChaCha/12 1.90 cpb
  * Salsa20/8 1.34 cpb; ChaCha/8 1.5 cpb
2018-10-23 07:57:59 -04:00
Jeffrey Walton
1bbbfb6b75
Fix partial specializations for FixedSizeAllocatorWithCleanup (PR #710)
Commit afbd3e60f6 effectively treated a symptom and not the underlying problem. The problem was linkers on 32-bit systems ignore CRYPTOPP_ALIGN_DAT(16) passed down by the compiler and align to 8-bytes or less. We have to use Wei's original code in some places. It is not a bad thing, but the bit fiddling is something we would like to contain a little more by depending more on language or platform features.

This commit keeps the original changes which improve partial specializations; but fixes 32-bit linker behavior by effectively reverting afbd3e60f6 and e054d36dc8. We also add more comments so the next person has understands why things are done they way they are.
2018-08-24 08:13:23 -04:00
Jeffrey Walton
afbd3e60f6
Fix alignment on Win32 and Solaris Sparc (PR #709)
These fixes were interesting in a morbid sort of way. I thought the FixedSizeAllocatorWithCleanup specializations faithfully reproduced semantics but I was wrong on Win32 and Sparc. Also see Commit e054d36dc8.

It seems there was another requirement or dependency that we missed, but it was not readily apparent. If I am parsing results correctly (which I may not be), it appears the bit twiddling using 8 byte alignment had more influence on alignment than I originally thought based on use of CRYPTOPP_BOOL_ALIGN16 and T_Align16. Or maybe the alignment attributes specified by CRYPTOPP_ALIGN_DATA are not being honored like they should for stack allocations.

This check-in avoids some uses of x86 movdqa (aligned) in favor of movdqu (unaligned). The uses were concentrated on memory operands which were 8-byte aligned instead of 16-byte aligned. It is not clear to me how the specializations lost 8-bytes of alignment. The check-in also enlists CRYPTOPP_ASSERT to tell us when there's a problem so we don't need to go hunting for bugs.
2018-08-23 14:42:29 -04:00
Jeffrey Walton
b74a6f4445
Add algorithm provider member function to Algorithm class 2018-07-06 09:23:37 -04:00
Jeffrey Walton
6faaf35195
Add Salsa20_Core transform (GH #630) (#632) 2018-04-02 03:51:51 -04:00
Jeffrey Walton
61ec50dabe
Change Doxygen comment style from //! to ///
Also see https://groups.google.com/forum/#!topic/cryptopp-users/A7-Xt5Knlzw
2017-11-29 10:54:33 -05:00
Jeffrey Walton
92436b9f9b
Re-enable Salsa20 ASM (GH #543)
We are fairly certain this is a false positive due to glibc's __memcmp_sse4_1.
2017-11-29 06:55:19 -05:00
Jeffrey Walton
a074722bfa
Switch to rotlConstant and rotrConstant
This will help Clang and its need for a constexpr
2017-11-25 02:52:19 -05:00
Jeffrey Walton
7851a0d510 Remove BOOL macro value (GH #462)
Currently the CRYPTOPP_BOOL_XXX macros set the macro value to 0 or 1. If we remove setting the 0 value (the #else part of the expression), then the self tests speed up by about 0.3 seconds. I can't explain it, but I have observed it repeatedly.
This check-in prepares for the removal in Upstream master
2017-08-20 21:25:29 -04:00
Jeffrey Walton
9d1f7f7539
Avoid use of SecBlock::m_ptr in Salsa 2017-08-17 16:27:56 -04: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
54d17c7361
Updated CRYPTOPP_ASSERT based on comments
Also see 399a1546de (commitcomment-19448453)
2016-10-17 22:00:31 -04:00
Jeffrey Walton
91ca6c117d Change from NDEBUG to CRYPTOPP_DEBUG in source files to ensure all debug behavior pivots on CRYPTOPP_DEBUG, and not NDEBUG (Issue 277, CVE-2016-7420) 2016-09-16 14:51:48 -04: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
a62aee441f Backed out use of "static const" to declare constant; switch to "enum" (Issue 255) 2016-09-06 04:04:03 -04:00
Jeffrey Walton
45323bddd8 Initial fix for older Apple ld's non_lazy_ptr missing symbols (Issue 255) 2016-09-06 02:51:16 -04: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
Jeffrey Walton
7e6c9438da Companion checkin to 572506de3d. Salsa and Sosemanuk can no longer reach into a SecBlock for and touch its private members 2015-08-03 19:06:18 -04:00
Jeffrey Walton
b7de164d62 Cut-in CRYPTOPP_ASSERT in all remaining header and source files 2015-07-26 16:03:14 -04:00
Jeffrey Walton
7b64ca489a Added "trap.h" include for header and source files that assert 2015-07-26 15:51:16 -04:00
Jeffrey Walton
3c56063c3f Added CRYPTOPP_CLANG_NO_INTEGRATED_AS as a guard in config.h (disabled by default since integrated-as is default behavior and the bug is active). GNU_ATT_SYNTAX → GNU_AS_ATT_SYNTAX and GNUINTEL_SYNTAX → GNU_AS_INTEL_SYNTAX 2015-07-21 18:05:48 -04:00
Jeffrey Walton
444d1f1a3b Cut-in to utilize GNU_ATT_SYNTAX and GNU_INTEL_SYNTAX macros. Also see LLVM Bug 18916 (https://llvm.org/bugs/show_bug.cgi?id=18916) 2015-07-21 14:37:55 -04:00
Jeffrey Walton
f03ab5cbd1 Removed execute bit from C++ header and source files 2015-06-24 14:15:29 -04:00
Jeffrey Walton
c6fde0fa5a Cleared unknown pragma warning with -Wall 2015-06-08 02:27:05 -04:00
weidai
f5912cc4e6 fix Salsa validation failure when compiling with GCC 4.6 (https://sourceforge.net/apps/trac/cryptopp/ticket/12) 2011-06-05 21:07:11 +00:00
weidai
3202bf2809 fix compile on OpenSolaris 8.11 2009-03-13 11:15:21 +00:00
weidai
2779fc6050 - add EAX mode, XSalsa20
- speed up GCM key setup
- wipe stack in AES assembly code
- speed up CFB mode
2009-03-12 11:24:12 +00:00
weidai
d8a644fc4e changes for 5.6:
- added AuthenticatedSymmetricCipher interface class and Filter wrappers
    - added CCM, GCM (with SSE2 assembly), CMAC, and SEED
    - improved AES speed on x86 and x64
    - removed WORD64_AVAILABLE; compiler 64-bit int support is now required
2009-03-02 02:39:17 +00:00
weidai
645b318c4d fix compile for ICC 10 2007-09-24 05:35:59 +00:00
weidai
9ee3a25d0d remove -msse2 since we don't use SSE2 intrinsics anymore 2007-09-24 03:52:17 +00:00
weidai
23accd43c5 - port x64 assembly code to MASM
- improve stack unwindability on x64 for GCC by not modifying RBP/RSP registers in inline assembly
2007-09-24 00:43:57 +00:00
weidai
b130b99781 fixed Salsa20 initialization crash on non-SSE2 machines 2007-08-13 23:48:17 +00:00
weidai
3dfcdf8c44 work around GCC bug for x64 2007-05-05 15:25:12 +00:00
weidai
f46f0d73c5 fix compile on Mac OS X 2007-05-04 20:46:32 +00:00
weidai
f41245df6f reduce risk of reusing random numbers after VM state rollback 2007-05-04 15:37:46 +00:00
weidai
3a3fef7436 fix compile on Sun CC 2007-04-16 05:40:37 +00:00
weidai
bbbd09553b SSE2 optimizations 2007-04-15 22:54:31 +00:00
weidai
4afd858ae4 port to Borland C++Builder 2006 2006-12-14 11:41:39 +00:00
weidai
28c392e082 add Salsa20 cipher 2006-12-09 17:18:13 +00:00