summaryrefslogtreecommitdiff
path: root/integer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix runtime crash when CRYPTOPP_INIT_PRIORITY=0Jeffrey Walton2017-03-271-9/+70
| | | | | | 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.
* Remove g_pAssignIntToInteger pointer, add CRYPTOPP_NO_ASSIGN_TO_INTEGER ↵Jeffrey Walton2017-03-251-28/+32
| | | | | | | (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.
* Simplify C++ dynamic object initializationJeffrey Walton2017-03-201-9/+7
| | | | | | | | | | | 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
* Fix compile under Visual Studio 2005/MSC 14.00Jeffrey Walton2017-03-181-1/+1
| | | | Previous testing occurred with Visual Studio 2005 SP 1, and it lacks some of the Safe C++/security enhanced functions.
* Updated static initializersJeffrey Walton2017-03-171-30/+54
| | | | | 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.
* Add C++ nullptr support (Issue 383)Jeffrey Walton2017-03-011-3/+3
|
* Backed off ASSERT. PKCS12_PBKDF and other classes use truncated buffersJeffrey Walton2017-01-291-1/+1
|
* Validate Integer::Decode inputLen (Issue 346)Jeffrey Walton2017-01-281-7/+4
|
* Change file preamble to include "originally written by Wei Dai"Jeffrey Walton2017-01-271-1/+1
| | | | We have made a fair number of changes, and we don't want WD to receive credit for issues he was not part of
* Removed debug instrumentationJeffrey Walton2017-01-231-10/+0
|
* Update documentationJeffrey Walton2017-01-231-3/+11
| | | | Added additional asserts
* Removed VC++ 5.0 and 6.0 workarounds (Issue 342)Jeffrey Walton2016-12-031-19/+8
|
* Silence select conversion warnings (Issue 340)Jeffrey Walton2016-12-021-0/+6
|
* Switch from WordCount() to reg.size() for bitopsJeffrey Walton2016-11-261-12/+12
| | | | 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
* Switch from WordCount() to reg.size() for bitopsJeffrey Walton2016-11-261-11/+11
| | | | 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
* Add Integer bitwise AND, OR and XOR (Issue 336)Jeffrey Walton2016-11-231-0/+136
|
* Cleanup commentsJeffrey Walton2016-10-181-2/+2
|
* Updated CRYPTOPP_ASSERT based on commentsJeffrey Walton2016-10-171-2/+2
| | | | Also see https://github.com/weidai11/cryptopp/commit/399a1546de71f41598c15edada28e7f0d616f541#commitcomment-19448453
* Add statics to anonymous namespaceJeffrey Walton2016-10-101-3/+3
|
* Cutover to SecByteBlock member for AES (Issue 302, CVE-2016-7544)Jeffrey Walton2016-09-301-81/+113
|
* Change to file scope statics for Zero(), One(), Two() (Thanks DB, Issue 310)Jeffrey Walton2016-09-291-3/+9
|
* Make Singleton<Integer> static with function scope (Issue 310)Jeffrey Walton2016-09-291-3/+6
| | | | | | | | | | | | | | | | | | 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 }
* Cleared Coverity finding CID 170385 (UNINIT_CTOR) (Issue 293)Jeffrey Walton2016-09-201-13/+22
|
* Change from NDEBUG to CRYPTOPP_DEBUG in source files to ensure all debug ↵Jeffrey Walton2016-09-161-6/+6
| | | | behavior pivots on CRYPTOPP_DEBUG, and not NDEBUG (Issue 277, CVE-2016-7420)
* Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)Jeffrey Walton2016-09-161-60/+60
| | | | 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
* Cleared "Types cannot be declared in anonymous union" (Issue 274)Jeffrey Walton2016-09-151-16/+20
| | | | Thanks to Martin Bonner at http://stackoverflow.com/a/39507183
* Removed ARMEL work-arounds from Integer class.Jeffrey Walton2016-09-081-14/+0
|
* Cleared SDLC warning under Visual Studio 2005Jeffrey Walton2016-07-131-1/+1
|
* Fix "Error: The operand ___LKDB cannot be assigned to" under Sun Studio 12.5 ↵Jeffrey Walton2016-07-081-1/+1
| | | | (formerly Issue 188)
* Merge 'solaris' dev branch into 'master'Jeffrey Walton2016-06-151-44/+112
|
* Cleared compile errors under Visual Studio .Net compilersJeffrey Walton2016-04-291-2/+2
|
* Use stdext::make_checked_array_iterator for reverse_copy on VS2008 and above ↵Jeffrey Walton2016-02-051-5/+9
| | | | (Issue 123)
* Cleared uninitialized variable warningJeffrey Walton2016-01-241-1/+1
|
* Fix compilation for armeabi with gcc-4.9, 5.0 toolchainsAlexander Afanasyev2016-01-231-1/+1
| | | | Refs: #119
* moved BE case before LE to improve performanceDevJPM2016-01-141-25/+25
|
* finalized patchDevJPM2016-01-131-7/+32
| | | added final components of the Integer patch
* applied main changesDevJPM2016-01-131-19/+91
| | | applied main changes from the Integer Patch
* added std::showbase supportDevJPM2016-01-131-1/+8
| | | applied the std::showbase part of the integer patch
* Increase range for GCC workaround on ARMEL. After speaking with AP from GCC, ↵Jeffrey Walton2016-01-091-1/+1
| | | | he states some issues are still likely present in Master, which is GCC 6.0
* Work around issue on ARMEL in MultiplyTop and GCC. ARMHF is OKJeffrey Walton2016-01-081-0/+14
|
* Fixed hang on ARM platforms in Integer::DivideThreeWordsByTwoJeffrey Walton2016-01-081-28/+0
|
* Microsoft ARM supportMarco Deckel2015-12-141-2/+2
| | | | * Adjusted config to compile for Microsoft ARM (e.g. Windows Universal apps)
* Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 ↵Jeffrey Walton2015-11-181-30/+154
| | | | (Coverity rollup)
* CRYPTOPP 5.6.3 RC6 checkinJeffrey Walton2015-11-051-4245/+4280
|
* Cleared "-Wunused-but-set-variable" warning due to Bot_2 macro on x86_64Jeffrey Walton2015-08-031-0/+8
|
* Removed USING_NAMESPACE(std). Changed cout → std::cout, cerr → ↵Jeffrey Walton2015-07-301-1/+1
| | | | std::cerr, ...
* Cut-in CRYPTOPP_ASSERT in all remaining header and source filesJeffrey Walton2015-07-261-50/+50
|
* Added "trap.h" include for header and source files that assertJeffrey Walton2015-07-261-0/+1
|
* Backed out commit 1dc875a44a2ef07fe9e86ac07d0dc70a4efb1fbd. MinGW complained ↵Jeffrey Walton2015-07-251-2/+0
| | | | "error: 'p0' was not declared in this scope". Thanks to Ilya Bizyaev for reporting
* Cleared "unused variable" warning under GCC 5.1Jeffrey Walton2015-07-251-0/+2
|