summaryrefslogtreecommitdiff
path: root/ecc-internal.h
Commit message (Collapse)AuthorAgeFilesLines
* Make ecc modular inversion use redc form, for relevant curves.invert-with-redcNiels Möller2020-01-291-1/+6
| | | | | | | | | | | | | | | | | | | * ecc-mod-inv.c (ecc_mod_inv_destructive): New helper function, not preserving input argument. Extracted from old ecc_mod_inv. (ecc_mod_inv): Call ecc_mod_inv_destructive. (ecc_mod_inv_redc): New inversion function, with input and output in redc form. * ecc-secp224r1.c: Select between ecc_mod_inv and ecc_mod_inv_redc. * ecc-secp256r1.c: Likewise. * ecc-j-to-a.c (ecc_j_to_a): Simplify redc-related logic, taking advantage of ecc->p.invert handling redc, when appropriate. Reduce scratch need from 5n to 4n in the process (assuming inversion needs 2n). * testsuite/ecc-modinv-test.c (ref_modinv): Updated to do redc, if appropriate.
* Fix comment typoNiels Möller2020-01-291-1/+1
|
* Merge branch 'delete-ecc-g'Niels Möller2020-01-281-3/+0
|\
| * Delete definition of ecc->gNiels Möller2020-01-251-3/+0
| |
* | Add GOST DSA according to GOST R 34.10-2001/-2012Dmitry Baryshkov2020-01-251-0/+7
| | | | | | | | | | | | | | | | Add GOST Digital Signature Algorithms support according to GOST R 34.10-2001/-2012. English translations of these standards are provided as RFC 5832 and RFC 7091. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | Add support for GOST GC512A curveDmitry Eremin-Solenikov2020-01-161-0/+1
| | | | | | | | | | | | | | | | Add support for GC512A curve ("TLS Supported Groups" registry, draft-smyshlyaev-tls12-gost-suites) also known as tc26-gost-3410-12-512-paramSetA (RFC 7836). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* | Add support for GOST GC256B curveDmitry Eremin-Solenikov2020-01-161-0/+3
|/ | | | | | | | | Add support for GC256B curve ("TLS Supported Groups" registry, draft-smyshlyaev-tls12-gost-suites) also known as GostR3410-2001-CryptoPro-A and GostR3410-2001-CryptoPro-XchA (RFC 4357). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* Fix comment typo.Niels Möller2020-01-021-1/+1
|
* Use add_hh rather than add_hhh for ecc_mul_a_eh.Niels Möller2019-12-251-1/+1
| | | | | | | | * ecc-mul-a-eh.c (ecc_mul_a_eh) [ECC_MUL_A_EH_WBITS == 0]: Use add_hh rather than add_hhh. (table_init) [[ECC_MUL_A_EH_WBITS > 0]: Likewise. * ecc-internal.h (ECC_MUL_A_EH_ITCH) [ECC_MUL_A_EH_WBITS == 0]: Reduced from 13*n to 12*n.
* Rename add and dup functions for Edwards curves.Niels Möller2019-12-181-12/+15
|
* New function ecc_mul_m.Niels Möller2019-12-141-0/+9
| | | | | | | | | | | | * curve25519-mul.c (curve25519_mul): Use ecc_mul_m. * curve448-mul.c (curve448_mul): Likewise. * ecc-mul-m.c (ecc_mul_m): New file and function. Implements multipliction for curves in Montgomery representation, as used for curve25519 and curve448. Extracted from curve25519_mul. * ecc-internal.h (ecc_mul_m): Declare. (ECC_MUL_M_ITCH): New macro. * Makefile.in (hogweed_SOURCES): Add ecc-mul-m.c.
* Revert itch macro changes.curve448Niels Möller2019-12-091-4/+1
| | | | | | | We now have h_to_a_itch <= mul_itch, mul_g_itch. Add asserts at a few places relying on this. (ECC_ECDSA_KEYGEN_ITCH, ECC_MAX): Delete macros. (ECC_ECDSA_SIGN_ITCH): Revert previous change.
* Implement Curve448 primitivesDaiki Ueno2019-11-301-2/+29
| | | | | | | This patch adds the necessary primitives for "curve448", defined in RFC 7748. Those primitives are namely: addition, doubling, scalar multiplication of the generator or an arbitrary point, inversion, and square root.
* Merge branch 'curve448' into masterNiels Möller2019-11-211-9/+12
|\
| * Delete unused pointer edwards_root from struct ecc_curve.Niels Möller2017-09-231-3/+0
| | | | | | | | | | | | * ecc-internal.h (struct ecc_curve): Delete unused pointer edwards_root. Update all instances. * eccdata.c (output_curve): Don't output it.
| * Comment fixes.Niels Möller2017-09-231-5/+4
| |
| * ecc: Add add_hh and dup members to ecc_curveDaiki Ueno2017-09-181-0/+8
| | | | | | | | | | | | | | | | This makes it possible to share the same code for curve25519 and curve448 primitives, which use different underlying formulas for addition and doubling. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | ecc-internal.h comment fixes.Niels Möller2019-09-261-4/+5
| |
* | abi: explicitly export intended symbols and hide othersNikos Mavrogiannopoulos2018-07-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds all exported symbols in the map files explicitly under the following rules: - Symbols mentioned in internal headers go in a section which is valid only for testing, and linking with these symbols will break in library updates. - Symbols mentioned in installed headers go in the exported sections and are considered part of the ABI. - All internal symbols move to internal headers. - The _nettle_md5_compress and _nettle_sha1_compress become exported without the _nettle prefix, due to existing usage.
* | Revert change hiding nettle_secp_256r1 and friends.api-opaque-fixNiels Möller2017-11-081-15/+0
| |
* | Undo added underscores on public symbols.Niels Möller2017-10-231-5/+14
| |
* | Define accessor functions to get address of ecc curve structs.Niels Möller2017-04-091-0/+6
|/
* Rename nettle_curve25519 to _nettle_curve25519, and remove declaration from ↵Niels Möller2015-03-191-0/+6
| | | | ecc-curve.h.
* Moved internal declarations from ecc.h to ecc-internal.h.Niels Möller2015-01-271-0/+109
|
* Added sqrt function to struct ecc_modulo.Niels Möller2014-10-021-5/+8
| | | | Reorganized curve25519 implementation to take a ratio as input.
* Changed ecc_hash argument type from struct ecc_curve to struct ecc_modulo.Niels Möller2014-09-231-1/+1
|
* curve25519: Use powering to compute modp inverses, 5.5 times faster than ↵Niels Möller2014-09-231-1/+2
| | | | ecc_mod_inv.
* ecc_mod_inv interface and allocation changes.Niels Möller2014-09-231-2/+2
|
* Renamed and generalized ecc_modq_random -> ecc_mod_random.Niels Möller2014-09-221-4/+4
|
* New ecc_mod_* functions, replacing ecc_modp_* and ecc_modq_*.Niels Möller2014-09-221-32/+43
|
* Added invert function pointer to struct ecc_modulo.Niels Möller2014-09-221-19/+10
| | | | | Updated and renamed sec_modinv -> ecc_mod_inv, and deleted the ecc_modp_inv and ecc_modq_inv wrapper functions.
* Moved mod and reduce function pointers to struct ecc_modulo.Niels Möller2014-09-221-20/+21
|
* Deleted redc function pointer.Niels Möller2014-09-221-1/+0
|
* Use struct ecc_modulo for all mod and redc functions.Niels Möller2014-09-221-9/+2
|
* Introduced struct ecc_modulo.Niels Möller2014-09-221-31/+27
|
* Deleted ecc_a_to_eh.Niels Möller2014-09-171-1/+0
|
* Let "affine" points for curve25519 be Edwards coordinates rather than ↵Niels Möller2014-09-171-1/+1
| | | | Montgomery coordinates.
* New function curve25519_eh_to_x.Niels Möller2014-09-021-0/+5
|
* New ecc_curve function pointer, add_hhh.Niels Möller2014-08-281-1/+8
|
* Deleted ECC_ECDSA_VERIFY_ITCH macro. Tweak the corresponding function, and ↵Niels Möller2014-08-281-2/+0
| | | | use it.
* Split ecc_generic_redc into two functions ecc_pp1_redc and ecc_pm1_redc.Niels Möller2014-08-281-2/+4
|
* Deleted unused constant redc_g.Niels Möller2014-08-281-3/+2
|
* New struct ecc_curve field, q_bit_size.Niels Möller2014-08-271-0/+1
|
* Merge branch 'curve25519'Niels Möller2014-08-271-7/+49
|\
| * Additional function pointers in struct ecc_curve.Niels Möller2014-08-251-1/+22
| | | | | | | | To support curve25519 point operations.
| * Reordered struct ecc_curve, moved function pointers before pointers to ↵Niels Möller2014-08-231-5/+5
| | | | | | | | bignum constants.
| * Implemented mod p square root for curve25519.Niels Möller2014-08-181-0/+4
| |
| * Fixed window-based ecc_mul_a_eh.Niels Möller2014-08-021-2/+3
| |
| * Implemented ecc_a_to_eh and ecc_mul_a_eh, for curve25519.Niels Möller2014-07-291-0/+9
| |
| * Reduce ecc_add_ehh scratch need.Niels Möller2014-07-261-1/+1
| |