Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Avoid needless alloc and copy | Jack Lloyd | 2018-06-21 | 1 | -0/+6 |
| | |||||
* | Avoid unnecessary realloc in BigInt::mod_sub | Jack Lloyd | 2018-06-17 | 1 | -2/+7 |
| | |||||
* | Fix a bug in Barrett reduction | Jack Lloyd | 2018-06-05 | 1 | -4/+3 |
| | | | | | | -x*n % n would reduce to n instead of zero. Also some small optimizations and cleanups. | ||||
* | Inline BigInt::shrink_to_fit | Jack Lloyd | 2018-05-09 | 2 | -7/+5 |
| | | | | Improves P-256 a bit | ||||
* | Inline this operator+ [ci skip] | Jack Lloyd | 2018-04-26 | 2 | -6/+1 |
| | |||||
* | Add BigInt functions for adding, subtracting and comparing with words | Jack Lloyd | 2018-04-26 | 4 | -51/+142 |
| | | | | Avoids needless allocations for expressions like x - 1 or y <= 4. | ||||
* | Add BigInt::mod_sub | Jack Lloyd | 2018-04-23 | 2 | -0/+65 |
| | |||||
* | Add const time annotations | Jack Lloyd | 2018-04-15 | 2 | -0/+20 |
| | |||||
* | Square is always positive | Jack Lloyd | 2018-04-08 | 1 | -0/+1 |
| | |||||
* | Add BigInt::square plus a speed test for BigInt multiply | Jack Lloyd | 2018-04-08 | 2 | -0/+22 |
| | |||||
* | Fix some Doxygen errors | Jack Lloyd | 2018-03-28 | 1 | -1/+2 |
| | |||||
* | Shift ECDSA inputs to match OpenSSL behavior | Jack Lloyd | 2018-03-21 | 2 | -0/+21 |
| | | | | See also GH #986 | ||||
* | Simplify a common case BigInt constructor | Jack Lloyd | 2018-03-21 | 2 | -1/+13 |
| | |||||
* | Store base point multiplies in a single std::vector | Jack Lloyd | 2018-03-20 | 2 | -0/+17 |
| | | | | | | | | | | | Since the point is public all the values are also, so this reduces pressure on the mlock allocator and may (slightly) help perf through cache read-ahead. Downside is cache based side channels are slightly easier (vs the data being stored in discontigious vectors). But we shouldn't rely on that in any case. And having it be in an array makes a masked table lookup easier to arrange. | ||||
* | Improve memory handling for PointGFp | Jack Lloyd | 2018-03-14 | 1 | -5/+0 |
| | |||||
* | Move declaration of word to types.h | Jack Lloyd | 2018-03-01 | 1 | -1/+1 |
| | |||||
* | Remove MP_WORD_BITS constant | Jack Lloyd | 2018-03-01 | 4 | -17/+17 |
| | | | | Use the BOTAN_MP_WORD_BITS consistently | ||||
* | Remove BigInt using functions from mp layer | Jack Lloyd | 2018-03-01 | 1 | -1/+5 |
| | |||||
* | Inline some simple BigInt sign handling functions | Jack Lloyd | 2018-03-01 | 2 | -32/+17 |
| | |||||
* | Avoid needless allocation in BigInt operator+= | Jack Lloyd | 2018-02-28 | 1 | -4/+2 |
| | | | | Kind of amazing what a difference that made for overall ECDSA perf | ||||
* | Optimize P-256 and P-384 reduction | Jack Lloyd | 2018-02-26 | 2 | -4/+14 |
| | | | | Precompute the multiples of the prime and then subtract directly. | ||||
* | Avoid some needless allocations | Jack Lloyd | 2018-02-26 | 1 | -11/+27 |
| | |||||
* | Optimize Barrett reduction | Jack Lloyd | 2018-02-26 | 3 | -4/+79 |
| | | | | | | | | | | OSS-Fuzz 6570 flagged an issue with slow modular exponentation. It turned out the problem was not in the library version but the simple square-and-multiply algorithm. Computing g^x % p with all three integers being dense (high Hamming weight) numbers took about 1.5 seconds on a fast machine with almost all of the time taken by the Barrett reductions. With these changes, same testcase now takes only a tiny fraction of a second. | ||||
* | Add BigInt::operator*= taking a word | Jack Lloyd | 2018-02-26 | 2 | -2/+23 |
| | | | | Avoids memory allocation when multiplying by a small constant. | ||||
* | Use reduce_below in PointGFp | Jack Lloyd | 2018-02-25 | 1 | -0/+2 |
| | | | | Improves ECDSA times by 2-3% | ||||
* | Add BigInt::reduce_below | Jack Lloyd | 2018-02-25 | 2 | -0/+33 |
| | |||||
* | Pass workspace size to various bigint_ functions | Jack Lloyd | 2018-02-25 | 2 | -2/+2 |
| | | | | | | These functions made assumptions about the workspace size available, which if incorrect would cause memory corruption. Since the length is always available at the caller, just provide it and avoid problems. | ||||
* | Minor optimizations in BigInt memory handling | Jack Lloyd | 2018-02-23 | 2 | -2/+4 |
| | | | | Makes 4-6% difference for ECDSA | ||||
* | Fix an error in BigInt operator- | Jack Lloyd | 2018-02-23 | 1 | -0/+1 |
| | | | | (x) - (-x) would result in -2x instead of the correct 2x | ||||
* | In PointGFp add/double avoid creating temporaries | Jack Lloyd | 2018-02-23 | 1 | -1/+7 |
| | | | | | | | We already had the temp workspace passed in but did not use it effectively... :/ Improves ECDSA sign and verify by 5-15% | ||||
* | New API for blinded ECC point multiplication | Jack Lloyd | 2018-02-21 | 1 | -1/+1 |
| | | | | No shared state | ||||
* | Minor optimizations for BigInt operator/ | Jack Lloyd | 2018-02-19 | 1 | -0/+6 |
| | | | | Detect divisions by small powers of 2 | ||||
* | Tiny optimization in BigInt::const_time_lookup | Jack Lloyd | 2018-02-13 | 1 | -1/+3 |
| | |||||
* | Remove needless variable | Jack Lloyd | 2017-10-06 | 1 | -2/+0 |
| | |||||
* | Add wrappers for reinterpret_cast between char* and uint8_t* | Jack Lloyd | 2017-10-03 | 3 | -5/+5 |
| | | | | | | | Generally speaking reinterpret_cast is sketchy stuff. But the special case of char*/uint8_t* is both common and safe. By isolating those, the remaining (likely sketchy) cases are easier to grep for. | ||||
* | Remove redundant parens | Jack Lloyd | 2017-10-03 | 1 | -1/+1 |
| | | | | Sonar | ||||
* | Use class for exception types | Jack Lloyd | 2017-10-02 | 1 | -2/+5 |
| | |||||
* | Use explicit on more single-argument constructors | Jack Lloyd | 2017-09-30 | 1 | -1/+1 |
| | |||||
* | Add valgrind annotations to check const_time_lookup | Jack Lloyd | 2017-09-26 | 1 | -0/+5 |
| | |||||
* | Use a side channel silent table look up in the Montgomery exponentiation | Jack Lloyd | 2017-09-25 | 2 | -0/+35 |
| | |||||
* | Apply final annotations to the library also | Jack Lloyd | 2017-09-22 | 1 | -2/+2 |
| | | | | | Done by a perl script which converted all classes to final, followed by selective reversion where it caused compilation failures. | ||||
* | Header file cleanups | Jack Lloyd | 2017-09-21 | 3 | -4/+4 |
| | | | | Some help from include-what-you-use | ||||
* | Change header guard format to BOTAN_FOO_H_ | Jack Lloyd | 2017-09-20 | 2 | -4/+4 |
| | | | | | | ISO C++ reserves names with double underscores in them Closes #512 | ||||
* | Add API stability annotations. | Jack Lloyd | 2017-09-19 | 2 | -13/+13 |
| | | | | | Defined in build.h, all equal to BOTAN_DLL so ties into existing system for exporting symbols. | ||||
* | Avoid using <iostream> header within the library | Jack Lloyd | 2017-09-02 | 1 | -1/+2 |
| | | | | We only need <istream> + <ostream> here | ||||
* | Content: | Tomasz Frydrych | 2017-04-03 | 1 | -1/+1 |
| | | | | | | | | | * fixes for deprecated constructions in c++11 and later (explicit rule of 3/5 or implicit rule of 0 and other violations) * `default` specifier instead of `{}` in some places(probably all) * removal of unreachable code (for example `return` after `throw`) * removal of compilation unit only visible, but not used functions * fix for `throw()` specifier - used instead `BOTAN_NOEXCEPT` * removed not needed semicolons | ||||
* | Remove "Dirty hack" for multiple defines in lex_me_harder() | Simon Warta | 2017-04-02 | 1 | -2/+4 |
| | |||||
* | Convert to using standard uintN_t integer types | Jack Lloyd | 2016-12-18 | 8 | -61/+61 |
| | | | | | | Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them. | ||||
* | Remove <source> block from info.txt files | Jack Lloyd | 2016-12-08 | 1 | -10/+0 |
| | | | | | | Kind of a vestigial thing from an earlier iteration of the module design, and never useful to specify anymore since taking all the cpp files is what you want exactly 100% of the time. | ||||
* | Merge GH #567/GH #457 TLS refactoring and Callbacks interface | Jack Lloyd | 2016-08-31 | 2 | -7/+4 |
|\ |