summaryrefslogtreecommitdiff
path: root/ecc-mod-inv.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve scratch usage in ecc_mod_inv.Niels Möller2020-11-141-2/+2
| | | | | | | | | | | | | * ecc-mod-inv.c (ecc_mod_inv): Use passed in scratch for all scratch needs, don't use memory after the result area. * ecc-ecdsa-sign.c (ecc_ecdsa_sign): Update invert call. * ecc-ecdsa-verify.c (ecc_ecdsa_verify): Likewise. * ecc-eh-to-a.c (ecc_eh_to_a): Likewise. * ecc-j-to-a.c (ecc_j_to_a): Likewise. * ecc-gostdsa-verify.c (ecc_gostdsa_verify): Likewise. * ecc-internal.h (ECC_MOD_INV_ITCH, ECC_J_TO_A_ITCH) (ECC_EH_TO_A_ITCH): Update accordingly, but no change in total scratch need.
* Delete ecc_mod_inv_redcNiels Möller2020-11-111-41/+12
|
* Add separate result argument to all mod functions.Niels Möller2020-10-301-2/+2
| | | | | * ecc-internal.h (typedef ecc_mod_func): Add separate result argument. Updated all C implementations and callers.
* Use GMP functions mpn_cnd_add_n, mpn_cnd_sub_n and mpn_cnd_swap.use-mpn_cnd-functionsNiels Möller2020-10-281-6/+6
|
* Make ecc modular inversion use redc form, for relevant curves.invert-with-redcNiels Möller2020-01-291-12/+41
| | | | | | | | | | | | | | | | | | | * 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.
* Add missing assert.Niels Möller2017-08-261-0/+1
|
* ecc_mod_inv interface and allocation changes.Niels Möller2014-09-231-22/+11
|
* Added invert function pointer to struct ecc_modulo.Niels Möller2014-09-221-0/+170
Updated and renamed sec_modinv -> ecc_mod_inv, and deleted the ecc_modp_inv and ecc_modq_inv wrapper functions.