Commit Graph

119 Commits (c797bd9523549add671b913aba5cb4a3669bdace)

Author SHA1 Message Date
Jeffrey Walton 23d95e803d
Provide virtual destructor for Threefish_Base 2017-11-19 01:39:47 -05:00
Jeffrey Walton 660681a884
Fix SunCC 12.2 compile 2017-11-13 12:30:46 -05:00
Jeffrey Walton bf717f47e6
Reduce C++ file scope class objects
Update comments and documentation
2017-11-12 11:55:57 -05:00
Jeffrey Walton 69c8a4f9c6
Prefix IS_LITTLE_ENDIAN and IS_BIG_ENDIAN with CRYPTOPP 2017-11-10 14:15:30 -05:00
Jeffrey Walton 6d459afa15 Revert "Bump Visual Studio version number for checked iterators (GH #496)"
This reverts commit 3b6e17b1. The version in Master was correct. The version the OP was using was incorrect.
2017-09-13 02:03:35 -04:00
Jeffrey Walton 3b6e17b1b4
Bump Visual Studio version number for checked iterators (GH #496) 2017-09-13 00:30:57 -04: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
Marcel Raad d9de314e86 Fix Windows compilation issues (by RaptorFactor) (#444)
* Fix compilation on Windows with /DUNICODE

* Fix linking of fipstest for MSVC targeting ARM (__crt_debugger_hook is not available).

* Fix build for Clang on Windows with optimizations on.

* Fix a warning about a non-existant warning under Clang.

* Fix compilation under Intel C++ 18.0 on Windows
2017-07-17 12:10:38 -04:00
Jeffrey Walton 555617d456
Clear coverity finding CONSTANT_EXPRESSION_RESULT (CID 147833) 2017-05-20 01:35:39 -04:00
Jeffrey Walton 537ee61ade
Switch to _MSC_FULL_VER for SP1 releases 2017-05-11 12:05:57 -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 7fb6b3df74
Fix compile under Visual Studio 2005/MSC 14.00
Previous testing occurred with Visual Studio 2005 SP 1, and it lacks some of the Safe C++/security enhanced functions.
2017-03-18 16:56:14 -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 6d86e546f9
Backed off ASSERT. PKCS12_PBKDF and other classes use truncated buffers 2017-01-29 00:19:28 -05:00
Jeffrey Walton de688a66d9
Validate Integer::Decode inputLen (Issue 346) 2017-01-28 23:17:33 -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
Jeffrey Walton 3dbf6e785c
Removed debug instrumentation 2017-01-23 21:33:23 -05:00
Jeffrey Walton 81669590d5
Update documentation
Added additional asserts
2017-01-23 19:25:06 -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 6eb2792bc2
Silence select conversion warnings (Issue 340) 2016-12-02 14:47:31 -05:00
Jeffrey Walton ccef9149af
Switch from WordCount() to reg.size() for bitops
This avoids a potential problem when OR'ing with 0 that results in a WordCount() of 1. Integer's minimum reg[] size is 2 due to RoundupSize(), and there could be implicit assumptions for the minimum that did not surface under testing
2016-11-26 00:56:02 -05:00
Jeffrey Walton beb9df9d9e
Switch from WordCount() to reg.size() for bitops
This avoids a potential problem when OR'ing with 0 that results in a WordCount() of 1. Integer's minimum reg[] size is 2 due to RoundupSize(), and there could be implicit assumptions for the minimum that did not surface under testing
2016-11-26 00:51:27 -05:00
Jeffrey Walton 16ffe513a4
Add Integer bitwise AND, OR and XOR (Issue 336) 2016-11-23 21:55:30 -05:00
Jeffrey Walton e794d53806
Cleanup comments 2016-10-18 02:23:07 -04: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 2d8992a547
Add statics to anonymous namespace 2016-10-10 18:20:49 -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 8518d22760
Change to file scope statics for Zero(), One(), Two() (Thanks DB, Issue 310) 2016-09-29 21:10:11 -04:00
Jeffrey Walton afe391571b
Make Singleton<Integer> static with function scope (Issue 310)
This may not fix the issue. Drilling into the issue from the web-based dashboard, Coverity is targeting:

    1. noescape: CryptoPP::Integer::operator =(CryptoPP::Integer const &) does not free or save its parameter t.

3049 Integer& Integer::operator=(const Integer& t)
3050 {
3051   if (this != &t)
3052   {
3053     if (reg.size() != t.reg.size() || t.reg[t.reg.size()/2] == 0)
3054       reg.New(RoundupSize(t.WordCount()));
3055     CopyWords(reg, t.reg, reg.size());
3056     sign = t.sign;
3057   }
3058   return *this;
3059 }
2016-09-29 14:31:54 -04:00
Jeffrey Walton 584f2f2ad1 Cleared Coverity finding CID 170385 (UNINIT_CTOR) (Issue 293) 2016-09-20 20:51:13 -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 f2e5149319 Cleared "Types cannot be declared in anonymous union" (Issue 274)
Thanks to Martin Bonner at http://stackoverflow.com/a/39507183
2016-09-15 09:38:40 -04:00
Jeffrey Walton c2d60cc91f Removed ARMEL work-arounds from Integer class. 2016-09-08 09:42:47 -04:00
Jeffrey Walton be4cc91a63 Cleared SDLC warning under Visual Studio 2005 2016-07-13 11:01:24 -04:00
Jeffrey Walton a011d5f9bf Fix "Error: The operand ___LKDB cannot be assigned to" under Sun Studio 12.5 (formerly Issue 188) 2016-07-08 19:05:01 -04:00
Jeffrey Walton b1df5736a7 Merge 'solaris' dev branch into 'master' 2016-06-15 05:02:28 -04:00
Jeffrey Walton 1ce593357f Cleared compile errors under Visual Studio .Net compilers 2016-04-29 10:25:18 -04:00
Jeffrey Walton f45813bd12 Use stdext::make_checked_array_iterator for reverse_copy on VS2008 and above (Issue 123) 2016-02-05 02:43:08 -05:00
Jeffrey Walton bce92ed5e5 Cleared uninitialized variable warning 2016-01-24 19:53:17 -05:00
Alexander Afanasyev 96c51ffb2c Fix compilation for armeabi with gcc-4.9, 5.0 toolchains
Refs: #119
2016-01-23 12:32:11 -08:00
DevJPM 07ff7b0d61 moved BE case before LE to improve performance 2016-01-14 12:24:36 +01:00
DevJPM fb9da4e043 finalized patch
added final components of the Integer patch
2016-01-13 23:24:39 +01:00
DevJPM ea980e5ec0 applied main changes
applied main changes from the Integer Patch
2016-01-13 23:19:49 +01:00
DevJPM ba0ce02134 added std::showbase support
applied the std::showbase part of the integer patch
2016-01-13 22:42:52 +01:00
Jeffrey Walton dce2317195 Increase range for GCC workaround on ARMEL. After speaking with AP from GCC, he states some issues are still likely present in Master, which is GCC 6.0 2016-01-09 00:09:06 -05:00
Jeffrey Walton 9fca0c2802 Work around issue on ARMEL in MultiplyTop and GCC. ARMHF is OK 2016-01-08 15:43:09 -05:00