summaryrefslogtreecommitdiff
path: root/integer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Tighten assert on Integer::OpenPGPEncodeJeffrey Walton2020-12-081-2/+2
|
* Use define CRYPTOPP_CXX11_STATIC_INIT nameJeffrey Walton2020-08-071-3/+3
|
* Update commentsJeffrey Walton2019-10-191-40/+15
|
* Use umulh for Aarch64 multiplyJeffrey Walton2019-10-181-1/+3
| | | | This saves about 30% on the Integer multiply operations. For example, RSA 1024 encryption goes from 0.068 to 0.044 ms/op. RSA 2048 goes from 0.170 to 0.100 ms/op. We should have taken this sooner. Ugh...
* Update commentsJeffrey Walton2019-06-091-7/+7
|
* Disable BMI2 code paths in Integer class (GH #850)Jeffrey Walton2019-06-011-1/+7
|
* Use BMI2 when available for MultiplyWordsLoHi, MulAcc and friendsJeffrey Walton2019-05-311-5/+6
| | | | Using BMI2 saves about 0.03 ms on a Core i5 6400 @ 2.7 GHz. It is small but measurable. It also gives GCC more freedom in selecting memory or register operands
* Use BMI2 when available for MultiplyWordsLoHi, MulAcc and friendsJeffrey Walton2019-05-311-0/+7
| | | | Using BMI2 saves about 0.03 ms on a Core i5 6400 @ 2.7 GHz. It is small but measurable. It also gives GCC more freedom in selecting memory or register operands
* Clear UBsan warning -Wstringop-overflowJeffrey Walton2019-04-271-2/+11
|
* Use IsPowerOf2 in Integer::DivideJeffrey Walton2019-02-051-1/+3
|
* Update commentsJeffrey Walton2019-02-051-24/+36
|
* Fix _M_IX86 typoJeffrey Walton2019-01-041-1/+1
|
* Use Microsoft x86-beased defined for __emuluJeffrey Walton2019-01-041-1/+1
|
* Fix Integer ARM64 compile with MSVC compiler (GH #776)Jeffrey Walton2019-01-031-1/+1
|
* Add CRYPTOPP_DISABLE_MIXED_ASM define and feature test (GH #756, PR #757)Jeffrey Walton2018-12-051-1/+1
|
* Add IBM XLC init priority supportJeffrey Walton2018-11-301-3/+10
|
* Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with AutotoolsJeffrey Walton2018-10-281-2/+2
| | | | Autotools sets up its config.h file with the '#define XXX 0' or '#define XXX 1' pattern. This check-in makes the sources Autotools aware. We need to verify CMake does the same
* Revert "Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools"Jeffrey Walton2018-10-281-1/+1
| | | | This reverts commit 04306f86ac36. It broke GCC 4.8 on PowerPC.
* Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with AutotoolsJeffrey Walton2018-10-271-1/+1
|
* Avoid Singleton when possible (GH #708)Jeffrey Walton2018-08-221-4/+4
| | | | Also clear several sign conversion warnings
* Update commentsJeffrey Walton2018-08-221-7/+5
|
* Update comments in integer.cppJeffrey Walton2018-08-211-0/+5
|
* Update comments in integer.cppJeffrey Walton2018-08-211-19/+31
|
* Avoid std::call_once (GH #707)Jeffrey Walton2018-08-211-66/+74
| | | | | This commit also favors init priorities over C++ dynamic initialization. After the std::call_once problems on Sparc and PowerPC I'm worried about problems with Dynamic Initialization and Destruction with Concurrency. We also do away with supressing warnings and use CRYPTOPP_UNUSED instead.
* Fix compile on Visual Studio 2005 without serve packsJeffrey Walton2018-08-201-1/+1
|
* Use IsZero()/NotZero() for 0 denominator testJeffrey Walton2018-07-031-4/+4
|
* Use '*this >= m' for InverseMod reductionJeffrey Walton2018-03-261-3/+3
| | | | The previous test used '*this > m', which did not capture 'm'
* Fix a_exp_b_mod_c and divide by 0 (GH #604)Jeffrey Walton2018-03-251-0/+6
|
* Add additional Integer class testsJeffrey Walton2018-03-251-1/+6
|
* Fix incorrect InverseMod (GH #602)Jeffrey Walton2018-03-251-2/+1
| | | | | | | | cryptest.sh revealed a corner case still producing an incorrect result. We need to check for '*this > m', not '*this > 2m-1'. The corner case looks obscure. The failure surfaced as 1 failed self test for about every 2048 tests. It was also in a code path where 'a' was explicitly set to '2m-1', with 'm' random. The test result can be duplicated with 'cryptest.exe v 9996 1521969687'. The value '1521969687' is a seed for the random number generator to reproduce.
* Fix incorrect InverseMod (GH #602) (#603)Jeffrey Walton2018-03-251-3/+17
|
* Clear clang-tidy warningsJeffrey Walton2018-01-241-25/+15
|
* Add CRYPTOPP_TABLE, remove CRYPTOPP_SECTIONJeffrey Walton2018-01-211-1/+5
|
* Clear clang-tidy warningsJeffrey Walton2018-01-021-8/+12
| | | | This commit also tweaks the way Integer parses byte arrays. The modified routines are slightly faster. On a Core-i5 6400 the self tests are 0.1 to 0.2 seconds faster
* Provide virtual destructor for Threefish_BaseJeffrey Walton2017-11-191-34/+50
|
* Fix SunCC 12.2 compileJeffrey Walton2017-11-131-5/+6
|
* Reduce C++ file scope class objectsJeffrey Walton2017-11-121-70/+62
| | | | Update comments and documentation
* Prefix IS_LITTLE_ENDIAN and IS_BIG_ENDIAN with CRYPTOPPJeffrey Walton2017-11-101-2/+2
|
* Revert "Bump Visual Studio version number for checked iterators (GH #496)"Jeffrey Walton2017-09-131-1/+1
| | | | This reverts commit 3b6e17b1. The version in Master was correct. The version the OP was using was incorrect.
* Bump Visual Studio version number for checked iterators (GH #496)Jeffrey Walton2017-09-131-1/+1
|
* Remove BOOL macro value (GH #462)Jeffrey Walton2017-08-201-6/+4
| | | | 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
* Fix Windows compilation issues (by RaptorFactor) (#444)Marcel Raad2017-07-171-0/+2
| | | | | | | | | | | | * 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
* Clear coverity finding CONSTANT_EXPRESSION_RESULT (CID 147833)Jeffrey Walton2017-05-201-1/+1
|
* Switch to _MSC_FULL_VER for SP1 releasesJeffrey Walton2017-05-111-1/+1
|
* 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
|