Commit Graph

3428 Commits (e1f2b696388655ad898dc40ab23ecf80578f8cf1)

Author SHA1 Message Date
Jeffrey Walton fdc262e884
Add tests for CRYPTOPP_NO_CXX11 to cryptest.sh (GH #529) 2017-11-06 09:10:37 -05:00
Jeffrey Walton e4cef84883
Add CRYPTOPP_NO_CXX11 for fake C++11 standard libraries (GH #529)
This is a recurring problem, especially on MinGW and platforms that use STLport. See the bug report for some references
2017-11-06 09:09:45 -05:00
Jeffrey Walton f40afed631
Add more Autotools artifacts to distclean recipe 2017-11-06 07:27:37 -05:00
Jeffrey Walton 5d7175bf03
Fix permissions 2017-11-05 07:22:18 -05:00
Jeffrey Walton 432881065c
Removed *.pl from clean rules 2017-11-05 07:21:09 -05:00
Jeffrey Walton 2e246b91d7
Fix missing Poly1305<AES> from Autools shared object on Solaris and Aarch64 2017-11-05 07:18:30 -05:00
Jeffrey Walton 9559517ce4
Fix broken link (GH #528) 2017-11-05 05:25:06 -05:00
Jeffrey Walton 3b43ce53ec
Add more Autotools artifacts to distclean recipe 2017-11-05 03:42:39 -05:00
Jeffrey Walton c50f2f23d8
Add more Autotools artifacts to distclean recipe 2017-11-05 03:38:19 -05:00
Jeffrey Walton 78a64e37d3
Remove cryptopp.mapfile from distclean rule 2017-11-01 18:30:49 -04:00
Jeffrey Walton defa3f78d1
Add more Autotools artifacts to distclean recipe 2017-11-01 18:25:44 -04:00
Jeffrey Walton a72225afff
Add more Autotools artifacts to distclean recipe 2017-11-01 15:51:10 -04:00
Jeffrey Walton 9e85633ff7
Add more Autotools artifacts to distclean recipe 2017-11-01 13:12:27 -04:00
Jeffrey Walton 0f2f753696
Add Autotools artifacts to distclean recipe 2017-11-01 12:11:04 -04:00
Jeffrey Walton bbf10b1250
Remove cryptest-windows.pl
It was useless fodder
2017-11-01 09:44:45 -04:00
Jeffrey Walton 04520725b6
Update Install.txt 2017-10-31 20:25:02 -04:00
Jeffrey Walton 6fb90f2b0c
Add additional examples to Install.txt (GH #525) 2017-10-31 17:14:53 -04:00
Jeffrey Walton dcabbd2112
Fix Elevated Warnings test
We were using HAVE_GCC and HAVE_CLANG instead of GCC_COMPILER and CLANG_COMPIELR
2017-10-30 08:33:16 -04:00
Jeffrey Walton 5be2c777f7
Disable ShellCheck SC2181 warning in cryptest.sh
Add tests for Support for Control-flow Enforcement Technology (CET). This is an upcoming processor feature. We want to be out in front of breaks to our inline assembly
2017-10-30 08:19:50 -04:00
Jeffrey Walton 4e6c4e0522
Fix Solaris build using SunCC
This broke when we fixed xlC builds on AIX
2017-10-27 18:09:40 -04:00
Jeffrey Walton 1eb49a8db6
Fix CPU frequency of 0 in script 2017-10-27 13:20:22 -04:00
Jeffrey Walton 27aa70c240
Fix checkshell warnings 2017-10-26 12:03:20 -04:00
Jeffrey Walton bc8edcef55
Removed OCB for the time being. The check-in did not occur.
Also see https://groups.google.com/d/msg/cryptopp-users/alCrCcPKv3A/alxMw3-dAgAJ
2017-10-20 21:55:01 -04:00
Jeffrey Walton 6f25cf682a
Improve 64-bit support for GCC on AIX 2017-10-18 05:55:12 -04:00
Jeffrey Walton c2c0a1ed82
Improve 64-bit support for XL C/C++ 2017-10-18 04:49:26 -04:00
Jeffrey Walton 7ba8c6bc81
Cleanup Altivec and Power7 code paths
This changes the dependency from Altivec to Power7. Internally we needed Power7 but it was cut-in as a pseudo Altivec dependency. Also see http://groups.google.com/forum/#!topic/cryptopp-users/fmEKOG41SG8
2017-10-17 22:50:45 -04:00
Jeffrey Walton f8d97b83ed
Fix compile on old PowerPC
This cleans up the compile on old PwerMac G5's. Our Altivec and Crypto code relies on Power7 and Power8 extensions. There's no need to shoehorn Altivec and Power4 into old platforms, so we disable Altivec and Crypto unless Power7 is available. The GNUmakefile sets CRYPTOPP_DISABLE_ALTIVEC if Power7 is not available.
2017-10-17 20:47:14 -04:00
Jeffrey Walton 9df87dc7d4
Cleanup cryptest.sh a bit 2017-10-16 06:39:50 -04:00
Jeffrey Walton 5dcf3e8554
Fix GCC -Wreorder warning 2017-10-13 04:40:12 -04:00
Jeffrey Walton 1315c1fe2f
Fix unwanted inlining of factory.h classes on AIX and Power7
Enable aligned allocations under IBM XL C/C++. Based on the AIX malloc man pages, "... the block is aligned so that it can be used for any type of data". Previously CRYPTOPP_NO_ALIGNED_ALLOC was in effect.

Use malloc instead of calloc on OS X. Based on the OS X malloc man pages, "... the allocated memory is aligned such that it can be used for any data type, including AltiVec- and SSE-related types". Additionally, calloc zero'd the memory it allocated which slowed things down on Apple systems.
2017-10-13 04:13:39 -04:00
Jeffrey Walton 437eda09e0
Tweak "ppc-crypto.h" include on Power7 2017-10-13 02:23:39 -04:00
Jeffrey Walton 3ffff750d7
Fix feature detection on AIX with XL C/C++ 2017-10-13 01:27:09 -04:00
Jeffrey Walton 642cf3aa74
Add "stdcpp.h" to bench1.cpp and bench2.cpp (GH #520)
This is the first of possibly two or three for Borland compilers. We have to be careful because its very easy to break something due to math overloads with other compilers like SunCC or XL/C
2017-10-12 21:52:23 -04:00
Jeffrey Walton f1a80e6a58
Detect XSAVE/XRESTORE OS feature support (GH #521)
This avoids the probe for SSE2 in most circumstances. The SSE2 test is mostly benign nowadays since SSE2 and OS support is nearly ubiquitous. But the define CRYPTOPP_NO_CPU_FEATURE_PROBES added for Apple OSes was interacting badly on x86 machines. Also see GH #511.
2017-10-12 20:14:21 -04:00
Jeffrey Walton c7a7385d52
Clear missing newline warning 2017-10-12 14:02:26 -04:00
Jeffrey Walton 24a19b7a18
Cleanup use of BMI intrinsics under GCC and compatibles 2017-10-09 21:14:21 -04:00
Jeffrey Walton 55fe79e5ee
Add governor.sh to run benchmarks from a performance state on Linux
The script is based on code by Andy Polyakov, http://www.openssl.org/~appro/cryptogams.
2017-10-08 14:12:16 -04:00
Jeffrey Walton 6e436427fb
Use SetMark to avoid unneeded zeroization in Rijndael 2017-10-08 12:05:33 -04:00
Jeffrey Walton ebcd91a0ac
Make UncheckedSetKey in authenc.h
UncheckedSetKey has traditionally been a protected member function. The public API traditionally uses SetKey (and friends) to set the key. Internally, SetKey may call UncheckedSetKey. It looks like UncheckedSetKey was made public when authenticated encryption support was added.
Its probably not a good idea to have users calling UncheckedSetKey. Most (all?) of the time it does nothing for authenc modes. The other remaining cases it may not work as expected.
2017-10-07 10:32:43 -04:00
Jeffrey Walton 01e46aa474
Move AliasedWithTable into unnamed namespace
Move m_aliasBlock into Rijndael::Base. m_aliasBlock is now an extra data member for Dec because the aliased table is only used for Enc when unaligned data access is in effect. However, the SecBlock is not allocated in the Dec class so there is no runtime penalty.

Moving m_aliasBlock into Base also allowed us to remove the Enc::Enc() constructor, which always appeared as a wart in my eyes. Now m_aliasBlock is sized in UncheckedSetKey, so there's no need for the ctor initialization.

Also see https://stackoverflow.com/q/46561818/608639 on Stack Overflow. The SO question had an unusual/unexpected interaction with CMake, so the removal of the Enc::Enc() ctor should help the problem.
2017-10-05 09:28:56 -04:00
Jeffrey Walton 1d0df34ae8
Add PKCS #1 SHA3-based signatures (GH #517) 2017-10-04 23:24:18 -04:00
Jeffrey Walton 73928489f9
Removed m_authenticated member variable
Add m_isSpecial, m_mandatoryBlockSize and m_optimalBufferSize members. The additional members stabilize running times and avoid some unnecessary calculations. Previously we were calculating some values in each call to Put and LastPut.
2017-10-03 21:49:59 -04:00
Jeffrey Walton 04d15304f1
Updated documentation 2017-10-03 20:47:03 -04:00
Jeffrey Walton 84390ee1e1
Add MandatoryBlockSize to last block test
CC optimizes things best when isSpecial uses the two predicates. If the 'm_cipher.MandatoryBlockSize() > 0' is removed, then some block ciphers and modes lose up to 0.2 cpb. Apparently GCC can optimize away the second predicate easier than the first predicate.
2017-10-03 15:46:51 -04:00
Jeffrey Walton aaeda3a57d
Update documentation 2017-10-01 09:37:36 -04:00
Jeffrey Walton 3cfbe66c82
Update documentation 2017-10-01 09:32:07 -04:00
Jeffrey Walton bbc6ea5355
Comments, constants and whitespace 2017-09-30 06:19:28 -04:00
Jeffrey Walton abc92b2e74
Updated documentation 2017-09-30 04:52:50 -04:00
Jeffrey Walton e92eb31690
Update StreamTransformation and ProcessLastBlock
Some authenticated encryption modes have needs that are not expressed well with MandatoryBlockSize() and MinLastBlockSize(). When IsLastBlockSpecial() returns true three things happen. First, standard block cipher padding is not applied. Second, the ProcessLastBlock() is used that provides inString and outString lengths. Third, outString is larger than inString by 2*MandatoryBlockSize(). That is, there's a reserve available when processing the last block.

The return value of ProcessLastBlock() indicates how many bytes were written to outString. A filter driving data will send outString and returned length to an AttachedTransformation() for additional processing.
2017-09-29 22:34:33 -04:00
Jeffrey Walton bebdc8b917
Add second ctor to StreamTransformationFilter for authenticated encryption modes
StreamTransformationFilter had a small hack to accomodate AuthenticatedEncryptionFilter and AuthenticatedDecryptionFilter. The hack was enough to support CCM, EAX and GCM modes, which looks a lot like a regular stream cipher from the filter framework point of view.

OCB is slightly different. To the filter framework it looks like a block cipher with an unusual last block size and padding scheme. OCB uses MandatoryBlockSize() == BlockSize() and  MinLastBlockSize() == 1 with custom padding of the last block (see the handling of P_* and A_* in the RFC). The unusual config causes the original StreamTransformationFilter assert to fire even though OCB is in a normal configuration.

For the time being, we are trying to retain the assert becuase it is a useful diagnostic. Its possible another authenticated encryption mode, like AEZ or NORX, will cause the assert to incorrectly fire (yet again). We will cross that bridge when we come to it.
2017-09-29 17:36:04 -04:00