aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/ec_gfp
Commit message (Collapse)AuthorAgeFilesLines
* cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-051-3/+3
| | | | explicit.
* Fix remaining Wshadow warnings and enable on gcc and clangRené Korthaus2016-02-182-4/+7
|
* Fix two bugs in 1.11.27 which caused test failures.1.11.28Jack Lloyd2016-02-011-3/+0
| | | | | | | | | | | | | The check on each individual size in curve_mul is too strict since we rely on redc(x*1) during the on the curve computation. Fix an off by one in ressol which caused it to occasionally reject valid values. Updating version 1.11.28 since existing 1.11.27 tag already pushed :( Fix an off-by-one in ressol which would cause it to occasionly give up too early.
* Fix heap overflow in ECC point multiplicationJack Lloyd2016-02-013-4/+19
| | | | | | | | | | | | | | If affine coordinates larger than the prime modulus were given, a later multiplication could overflow the size of an allocated output buffer, which was sized based on the size of the prime. This will cause an overflow into either the system heap or if the mlock/mmap pool allocator is in use, then into the adjacent key material stored in the pool. Reported by Alex Gaynor who found it with AFL Also fix a one word overwrite in P-521 reduction. Found with AFL
* Add final attribute to many classesJack Lloyd2016-01-101-6/+6
| | | | | | | In some cases this can offer better optimization, via devirtualization. And it lets the user know the class is not intended for derivation. Some discussion in GH #402
* Fix PointGFp multiplication bugJack Lloyd2016-01-031-18/+0
| | | | | | There was a special case for small scalars which managed to forget that the integer 3 also fits into two bits. Found by adding a new set of ECC point mul tests for the NIST curves.
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-2/+2
| | | | | | | | As the alternatives are unfortunate for applications trying to catch all library errors, and it seems deriving from std::runtime_error causes problems with MSVC DLLs (GH #340) Effectively reverts 2837e915d82e43
* Remove call to abort on a zero point in PointGFp::get_affine_{x,y}Jack Lloyd2015-11-131-4/+0
|
* Move GF(p) side channel countermeasure toggles to build.hJack Lloyd2015-08-282-28/+43
| | | | Some tweaks for point multiplication using fixed windows.
* Add power analysis countermeasures for ECC point multiplications.Jack Lloyd2015-08-212-128/+251
| | | | | | | | The plain PointGFp operator* now uses Montgomery ladder exclusively. Adds a blinded point multiply algorithm which uses exponent and point randomization, as well as a Montgomery ladder technique that takes a random walk of the possible addition chains for k.
* Expose the NIST prime values and reduction operations as plain functions.Jack Lloyd2015-08-085-255/+229
| | | | | | Previously they were hidden away as private functions on the CurveGFp types. This allows directly testing the reduction functions against other computational methods.
* lib/math: Convert &vec[0] to vec.data()Daniel Seither2015-06-203-8/+8
|
* Add BOTAN_DLL back to LibraryInitializer and move some of the implementation tolloyd2015-03-111-1/+3
| | | | | | | a source file. Without BOTAN_DLL the LibraryInitializer was removed entirely from the list of symbols which is not desired. Add some casts to avoid scary sounding but (upon review) harmless warnings from MSVC
* Comile fixes for VC 2013. Based on github pull 56neusdan2015-03-101-1/+1
|
* Add specialized reducers for P-192, P-224, P-256 and P-384lloyd2015-02-264-16/+636
|
* Reference the EC point add and double algorithms usedlloyd2015-01-241-0/+8
|
* Ensure all files have copyright and license info.lloyd2015-01-106-6/+6
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* 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-156-3/+229
| | | | | 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
|
* 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)
* Use 20 Miller-Rabin iterations regardless of the size of the integer. Thislloyd2014-04-131-1/+2
| | | | | provides a much better worst-case error bound. Also take the nonce from anywhere in the usable range rather than limiting the bit size.
* Move lib into srclloyd2014-01-104-0/+1083