aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math
Commit message (Collapse)AuthorAgeFilesLines
* Remove algo factory, engines, global RNG, global state, etc.lloyd2015-02-041-2/+0
| | | | | | | | | | | | | | | Convert all uses of Algorithm_Factory and the engines to using Algo_Registry The shared pool of entropy sources remains but is moved to EntropySource. With that and few remaining initializations (default OIDs and aliases) moved elsewhere, the global state is empty and init and shutdown are no-ops. Remove almost all of the headers and code for handling the global state, except LibraryInitializer which remains as a compatability stub. Update seeding for blinding so only one hacky almost-global RNG instance needs to be setup instead of across all pubkey uses (it uses either the system RNG or an AutoSeeded_RNG if the system RNG is not available).
* Convert PK operations to using Algo_Registry instead of Engine.lloyd2015-02-031-18/+6
| | | | Remove global PRNG.
* Add missing files. Remove cipher lookup from engine code.lloyd2015-02-012-10/+3
|
* Reference the EC point add and double algorithms usedlloyd2015-01-241-0/+8
|
* Ensure all files have copyright and license info.lloyd2015-01-1046-46/+46
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* This assumed other headers it did not includelloyd2015-01-081-1/+2
|
* Side channel commentarylloyd2015-01-082-0/+26
|
* Inline BigInt::get_bit and byte_atlloyd2015-01-082-23/+9
|
* Switch to using Montgomery ladder for EC point multiplication.lloyd2014-12-101-48/+4
| | | | | The test function create_random_point did not actually create a point on the curve - fix.
* Add specialized reduction for P-521 along with 9x9 Comba routines.lloyd2014-11-1511-12/+461
| | | | | Roughly 35-50% faster on my laptop (depending on if mlock is enabled, the overhead in that allocator is becoming much more of a hotspot).
* Use noexcept on swaplloyd2014-11-041-1/+1
|
* Handle new source filelloyd2014-10-061-4/+0
|
* Asserts here are nicelloyd2014-08-091-2/+7
|
* Move mul and square operations on a elliptic curve to CurveGFp so welloyd2014-08-094-213/+279
| | | | | can use different representations/operations depending on the curve (eg, using a specialized version for P-256 reduction)
* Avoid GCC 4.9 strict-overflow warninglloyd2014-05-031-3/+2
|
* Any fixed MR iterations is probably wrong for somebody. Allow the userlloyd2014-04-254-7/+49
| | | | | | to specify a probability as well as if n was randomly chosen or not. If the input is random use a better bounds to reduce the number of needed tests.
* Use 20 Miller-Rabin iterations regardless of the size of the integer. Thislloyd2014-04-134-186/+42
| | | | | provides a much better worst-case error bound. Also take the nonce from anywhere in the usable range rather than limiting the bit size.
* Fix a bug in Miller-Rabin primality testing introduced in 1.8.3lloyd2014-04-101-5/+6
| | | | | | | | where we chose a single random nonce and tested it repeatedly, rather than choosing new nonces each time. Reported by Jeff Marrison. Also remove a pointless comparison (also pointed out by Jeff) and add an initial test using a witness of 2.
* Avoid a ubsan warning on GCC 4.9 due uninitialized sign enum beinglloyd2014-03-302-5/+1
| | | | read during swap (in the move constructor)
* Clang fixeslloyd2014-02-091-1/+0
|
* Guess I won't be needing theselloyd2014-01-181-1/+0
|
* Move lib into srclloyd2014-01-1051-0/+8875