Commit Graph

65 Commits

Author SHA1 Message Date
Jeffrey Walton
412204e4d2
Fix typos 2021-04-09 23:46:33 -04:00
Jeffrey Walton
bbc45ddfd7
Fix CTR mode when using FileSource (GH #683, GH #1010)
We think this is another instance problem that surfaced under GH #683 when inString==outString. It violates aliasing rules and the compiler begins removing code.

The ultimate workaround was to add a member variable m_tempOutString as scratch space when inString==outString. We did not loose much in the way of perforamce for some reason. It looks like AES/CTR lost about 0.03-0.05 cpb.

When combined with the updated xorbuf from GH #1020, the net result was a speedup of 0.1-0.6 cpb. In fact, some ciphers like RC6, gained almost 5 cpb.
2021-03-17 12:25:40 -04:00
Jeffrey Walton
ca123d14c1
Avoid memcpy in AdditiveCipherTemplate<S>::ProcessData (GH #683, GH #1010, PR #1019)
We found we can avoid the memcpy in the previous workaround by using a volatile pointer. The pointer appears to tame the optimizer so the compiler does not short-circuit some calls when outString == inString.
2021-03-16 22:01:24 -04:00
Jeffrey Walton
4d15863b71
Update documentation 2021-03-16 20:32:16 -04:00
Jeffrey Walton
f7e6af6344
Add EnumToInt conversion macro for enum-enum conversion warnings (GH #1016) 2021-03-09 22:51:19 -05:00
Jeffrey Walton
de45ebeec1
Clear C++20 enum-enum conversion warnings (GH #1016) 2021-03-09 21:56:24 -05:00
Jeffrey Walton
ac6987f3ae
Use \return and \throw consitently in the docs 2020-12-07 23:35:10 -05:00
Jeffrey Walton
9013cb60fb
Fix semicolons yet again (GH #889)
So it looks like sed added a '\r' between the closing paren and the semi. Grepping for '^;' failed because the '\r' was considered part of the previous line, so it showed no hits. I finally had to write a C program to properly identify and fix those damn stray semicolons.
2019-10-14 12:30:10 -04:00
Jeffrey Walton
589c25264a Don't add semicolon to CRYPTOPP_CONSTANT abd DOCUMENTED_TYPEDEF (GH #889)
This issue is a recurring issue. Let's try fixing it in the #define this time.
2019-10-03 19:40:53 -04:00
Jeffrey Walton
83f41e0d76
Update documentation 2019-01-26 00:12:11 -05:00
Jeffrey Walton
778f6f122d
Remove potential UB from CFB_CipherConcretePolicy 2018-11-19 23:40:51 -05:00
Jeffrey Walton
90e7b85814
Update documentation 2018-07-12 12:04:37 -04:00
Jeffrey Walton
ed143608a8 Revert "Increase use of ptrdiff_t when performing pointer math"
This reverts commit bbf9a109f2. It did not fix A-32. Something got crossed in my test case.
2018-07-12 09:43:18 -04:00
Jeffrey Walton
bbf9a109f2
Increase use of ptrdiff_t when performing pointer math
This fixes the incorrect result with CFB mode on A-32 in CFB_CipherTemplate<BASE>::ProcessData
2018-07-12 08:29:46 -04:00
Jeffrey Walton
bdac2de36e
Increase use of ptrdiff_t when performing pointer math 2018-07-10 17:41:23 -04:00
Jeffrey Walton
b74a6f4445
Add algorithm provider member function to Algorithm class 2018-07-06 09:23:37 -04:00
Jeffrey Walton
d00777e1d7
Add Rabbit stream cipher (GH #678) 2018-07-04 03:47:28 -04:00
Jeffrey Walton
94e0b3c954
Update documentation 2018-07-03 23:35:36 -04:00
Marcel Raad
7c1d296283 Fix clang warnings in headers (#655)
* remove superfluous semicolon

* Remove C-style casts from public headers

clang warns about them with -Wold-style-cast. It also warns about
implicitly casting away const with -Wcast-qual. Fix both by removing
unnecessary casts and converting the remaining ones to C++ casts.
2018-05-10 19:59:21 -04:00
Jeffrey Walton
befd04312d
Remove unneeded Doxygen directive 2018-01-19 14:31:20 -05: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
37e02f9e0e
Revert AltiVec and Power8 commits
The strategy of "cleanup under-aligned buffers" is not scaling well. Corner cases are still turing up. The library has some corner-case breaks, like old 32-bit Intels. And it still has not solved the AltiVec and Power8 alignment problems.
For now we are backing out the changes and investigating other strategies
2017-09-05 16:28:00 -04:00
Jeffrey Walton
32cc92e048
Fixup under-aligned buffers for stream ciphers on AltiVec and Power8
This commit supports the upcoming AltiVec and Power8 processor support for stream ciphers. This commit affects GlobalRNG() most because its an AES-based generator. The commit favors AlignedSecByteBlock over SecByteBlock in places where messages are handled on the AltiVec and Power8 processor data paths. The data paths include all block cipher modes of operation, and some filters like FilterWithBufferedInput.

Intel and ARM processors are tolerant of under-aligned buffers when using crypto instructions. AltiVec and Power8 are less tolerant, and they simply ignore the three low-order bits to ensure an address is aligned. The AltiVec and Power8 have caused a fair number of wild writes on the stack and in the heap.

Testing on a 64-bit Intel Skylake show a marked improvement in performance. We suspect GCC is generating better code since it knows the alignment of the pointers, and does not have to emit fixup code for under-aligned and mis-aligned data. Testing on an mid-2000s 32-bit VIA C7-D with SSE2+SSSE3 showed no improvement, and no performance was lost.
2017-09-04 11:03:10 -04:00
Jeffrey Walton
2c9a3039e8
Update documentation
This cleanup was performed using Clang and -Wdocumentation -Wno-documentation-deprecated-sync
2017-07-27 19:15:21 -04:00
Jeffrey Walton
7ac77ca9ac Revert "Revert "Clear Visual Studio warnings (Issue 412)""
This reverts commit c3871aec94.
2017-06-02 05:18:52 -04:00
Jeffrey Walton
c3871aec94 Revert "Clear Visual Studio warnings (Issue 412)"
This reverts commit eb3b27a6a5. The change broke GCC 4.8 and unknown version of Clang on OS X. UB reported the OS X break, and JW found duplicated the break on a ARM CubieTruck with GCC 4.8.
2017-06-02 05:06:56 -04:00
Jeffrey Walton
eb3b27a6a5
Clear Visual Studio warnings (Issue 412) 2017-05-30 16:37:41 -04:00
Jeffrey Walton
5efb019d8b
Add C++ nullptr support (Issue 383) 2017-03-01 06:10:06 -05: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
klemens
5a5c633073 spelling fixes 2016-12-27 18:34:57 +01: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
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
894874fe75 Whitespace checkin 2016-09-10 04:57:48 -04:00
Jeffrey Walton
131fd4bb7b Updated documentation 2016-04-22 00:03:03 -04:00
Jeffrey Walton
746b618c3e Updated documentation 2016-04-21 23:06:26 -04:00
Jeffrey Walton
48809d4e85 CRYPTOPP 5.6.3 RC6 checkin 2015-11-05 01:59:46 -05:00
Jeffrey Walton
378461b525 Cleared compiler error when compiling with "-DDEBUG" 2015-07-26 16:28:04 -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
ef5a8f883c Cleared -Wparentheses from GCC 5.1 2015-07-19 11:27:11 -04: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
e4295fda97 fix compile on ICC 11 2009-03-04 09:27:52 +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
244f99c027 fix infinite recursive call in IsRandomAccess (reported by ASBai) 2008-02-02 08:40:27 +00:00
weidai
ce494f5bb4 add missing virtual destructors 2007-06-01 17:29:27 +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
43b41c1042 update version number, port to Sun C++ 5.8 2006-12-18 02:34:33 +00:00