Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add EC_Group::clear_registered_curve_data | Jack Lloyd | 2018-03-19 | 2 | -0/+16 |
| | | | | | | Needed for OSS-Fuzz (OOMing a lot) and maybe very occasionally useful in some weird application that has to deal with 100s of different curves. | ||||
* | Cache additional values for PointGFp multi-exponentiation | Jack Lloyd | 2018-03-19 | 4 | -61/+99 |
| | | | | Improves ECDSA verification by ~10% | ||||
* | Avoid needless computation in base point multiply | Jack Lloyd | 2018-03-19 | 3 | -33/+6 |
| | | | | We computed twice as many values as were used. | ||||
* | Use a better algorithm for base point multiplies | Jack Lloyd | 2018-03-19 | 2 | -10/+24 |
| | | | | | | | Nothing very clever, just store P^i,2*P^i,3*P^i in a table so we can do two bits of the scalar at a time. Improves ECDSA sign by 20-30% | ||||
* | Catch exceptions by reference not value | Jack Lloyd | 2018-03-16 | 1 | -1/+1 |
| | | | | Fixes a new warning in GCC 8 | ||||
* | Add a facility for debug-mode assertions | Jack Lloyd | 2018-03-14 | 3 | -2/+9 |
| | | | | | When we want to check something but it is to expensive to do so in normal builds. | ||||
* | Assume CurveGFp inputs are at most p words long | Jack Lloyd | 2018-03-14 | 1 | -13/+27 |
| | | | | Lets us avoid calling sig_words much of the time. Improves ECDSA 5-7% | ||||
* | Avoid creating a temp here | Jack Lloyd | 2018-03-14 | 1 | -4/+4 |
| | |||||
* | Improve memory handling for PointGFp | Jack Lloyd | 2018-03-14 | 5 | -63/+83 |
| | |||||
* | Tweaks to force_all_affine | Jack Lloyd | 2018-03-12 | 1 | -7/+5 |
| | |||||
* | Merge GH #1483 Use uncompressed points for ECC by default | Jack Lloyd | 2018-03-10 | 3 | -37/+42 |
|\ | |||||
| * | Add PointGFp::encode as replacement for EC2OSP | Jack Lloyd | 2018-03-10 | 3 | -37/+42 |
| | | | | | | | | | | | | Literally every single call to EC2OSP is converting the returned secure_vector to a std::vector. Which makes sense since private points are not really a thing in any protocol I know of. | ||||
* | | Revert "Use move to avoid needless some needless copies" | Jack Lloyd | 2018-03-10 | 1 | -16/+16 |
|/ | | | | | | | | This reverts commit 5185c2aaa8bf9556556e4507869042a71eaba6c0. Clang says warning: moving a temporary object prevents copy elision [-Wpessimizing-move] | ||||
* | Use move to avoid needless some needless copies | Jack Lloyd | 2018-03-09 | 1 | -16/+16 |
| | |||||
* | Cleanup comments | Jack Lloyd | 2018-03-09 | 1 | -10/+7 |
| | |||||
* | Add blinded_base_point_multiply_x | Jack Lloyd | 2018-03-08 | 2 | -0/+20 |
| | | | | Often useful when the point is not needed | ||||
* | Mul into temps to avoid allocations | Jack Lloyd | 2018-03-08 | 1 | -7/+8 |
| | |||||
* | Add PointGFp::force_all_affine using Montgomery's trick | Jack Lloyd | 2018-03-08 | 3 | -9/+68 |
| | | | | Also be somewhat smarter in force_affine avoids several muls | ||||
* | Require explicit calls to add_affine | Jack Lloyd | 2018-03-08 | 2 | -5/+2 |
| | | | | Skipping the checks saves 3-7% for ECDSA | ||||
* | Add destructor for unique_ptr | Jack Lloyd | 2018-03-08 | 2 | -0/+7 |
| | |||||
* | Add mixed (J+A) point addition, new scalar mul for base points | Jack Lloyd | 2018-03-08 | 9 | -123/+392 |
| | | | | | | | | | Adds PointGFp::force_affine(), ::add_affine(), and ::is_affine() Use a (very simple) technique for base point precomputations. Stick with fixed window for variable point inputs. Scalar blinding is now always enabled | ||||
* | Support decoding of ECC groups with seed parameter | Jack Lloyd | 2018-03-04 | 1 | -0/+2 |
| | | | | Closes GH #874 | ||||
* | Use Barrett instead of repeated divisions by p here | Jack Lloyd | 2018-03-04 | 1 | -3/+6 |
| | | | | Doesn't matter much since its a one time setup cost but can't hurt. | ||||
* | Reduce temp usage in PointGFp addition and doubling | Jack Lloyd | 2018-03-04 | 4 | -104/+95 |
| | | | | No noticable change in performance | ||||
* | Avoid confusing error if invalid EC_Group is used | Jack Lloyd | 2018-03-02 | 1 | -3/+9 |
| | | | | | If an unknown group name was passed it would give a PEM error, instead of saying unknown group. | ||||
* | Remove BigInt using functions from mp layer | Jack Lloyd | 2018-03-01 | 1 | -6/+19 |
| | |||||
* | Fix overflow in monty_redc | Jack Lloyd | 2018-02-27 | 1 | -4/+4 |
| | | | | | | | | | OSS-Fuzz caught a bug introduced in 5fcc1c70d7a. bigint_monty_redc assumes z is 2*p_words+2 words long. Previously the implicit rounding up in grow_to ensured a resize would result in a sufficiently large value. OSS-Fuzz 6581 6588 6593 | ||||
* | Avoid unnecessary calls to BigInt::grow_to | Jack Lloyd | 2018-02-26 | 1 | -4/+9 |
| | |||||
* | Avoid using monty workspace for reduce_below | Jack Lloyd | 2018-02-26 | 1 | -6/+6 |
| | | | | | | | | | If the workspace is swapped, then it is too small for the Montgomery operation and will be reallocate on the next sqr/multiply operation. Also use ws[9] consistently for the Montgomery workspace, otherwise if add needs to pass off the mult2, the workspaces are not the expected size and again a reallocation occurs. | ||||
* | Avoid some needless allocations | Jack Lloyd | 2018-02-26 | 1 | -2/+4 |
| | |||||
* | Add functions to EC_Group for getting base point coordinates | Jack Lloyd | 2018-02-25 | 2 | -9/+43 |
| | |||||
* | Merge ec_gfp and ec_group modules | Jack Lloyd | 2018-02-25 | 6 | -2/+1525 |
| | | | | | They were already somewhat entangled and future work will increase that (eg by having PointGFp hold a pointer to EC_Group) | ||||
* | Add EC_Group::verify_public_element | Jack Lloyd | 2018-02-23 | 2 | -0/+31 |
| | |||||
* | Small cleanup | Jack Lloyd | 2018-02-21 | 1 | -3/+8 |
| | |||||
* | Minimize header dependencies | Jack Lloyd | 2018-02-21 | 1 | -1/+2 |
| | |||||
* | Expose EC_Group::a_is_minus_3 | Jack Lloyd | 2018-02-21 | 2 | -1/+15 |
| | |||||
* | New API for blinded ECC point multiplication | Jack Lloyd | 2018-02-21 | 2 | -1/+33 |
| | | | | No shared state | ||||
* | Merge GH #1454 Used shared_ptr repr for DL_Group | Jack Lloyd | 2018-02-19 | 1 | -5/+0 |
|\ | |||||
| * | Move allocator initializer RAII class to mem_ops.h | Jack Lloyd | 2018-02-19 | 1 | -5/+0 |
| | | | | | | | | May be needed elsewhere | ||||
* | | Merge GH #1448 Support custom curves in TLS handshake | Jack Lloyd | 2018-02-19 | 1 | -3/+0 |
|\ \ | |/ |/| | |||||
| * | Remove house curve support | Jack Lloyd | 2018-02-13 | 1 | -3/+0 |
| | | |||||
* | | Add point_multiply operation to EC_Group | Jack Lloyd | 2018-02-18 | 2 | -0/+14 |
| | | | | | | | | Allows precomputations in the future. | ||||
* | | Add functions to reduce integers mod the order to EC_Group | Jack Lloyd | 2018-02-18 | 2 | -9/+65 |
|/ | | | | | | This allows calculating the Barett reduction params just once, when the group is initialized, then sharing them across all operations which use that group. | ||||
* | Alternate method of forcing allocator initialization | Jack Lloyd | 2018-02-04 | 1 | -1/+6 |
| | | | | That doesn't require a malloc/free every time we call ec_group_data() | ||||
* | Add hack to deal with initialization fiasco | Jack Lloyd | 2018-02-04 | 1 | -0/+6 |
| | |||||
* | Create a persistent registry for ECC group data | Jack Lloyd | 2018-02-04 | 3 | -380/+480 |
| | | | | Now a single copy is maintained of each EC group info | ||||
* | Fix deprecation warnings | Jack Lloyd | 2018-02-01 | 2 | -11/+20 |
| | |||||
* | Avoid CurveGFp in EC_Group interface | Jack Lloyd | 2018-01-31 | 2 | -20/+105 |
| | |||||
* | Use shared representation of EC_Group | Jack Lloyd | 2018-01-31 | 2 | -79/+262 |
| | | | | Hide CurveGFp with an eye for eventual removal | ||||
* | Prepare for making BER_Object members private | Jack Lloyd | 2018-01-18 | 1 | -3/+3 |
| | | | | | Now there are usable accessors that allow the library to avoid using BER_Object members directly. |