summaryrefslogtreecommitdiff
path: root/ecc-j-to-a.c
Commit message (Collapse)AuthorAgeFilesLines
* New functions ecc_mod_mul_canonical and ecc_mod_sqr_canonical.Niels Möller2021-03-111-12/+3
| | | | | | | | | | | * ecc-mod-arith.c (ecc_mod_mul_canonical, ecc_mod_sqr_canonical): New functions. * ecc-internal.h: Declare and document new functions. * curve448-eh-to-x.c (curve448_eh_to_x): Use ecc_mod_sqr_canonical. * curve25519-eh-to-x.c (curve25519_eh_to_x): Use ecc_mod_mul_canonical. * ecc-eh-to-a.c (ecc_eh_to_a): Likewise. * ecc-j-to-a.c (ecc_j_to_a): Likewise. * ecc-mul-m.c (ecc_mul_m): Likewise.
* Improve scratch usage in ecc_mod_inv.Niels Möller2020-11-141-1/+1
| | | | | | | | | | | | | * 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.
* Separate result area for ecc_mod_mul and ecc_mod_sqr.Niels Möller2020-11-011-4/+4
| | | | | | | | * ecc-mod-arith.c (ecc_mod_mul, ecc_mod_sqr): Separate argument for scratch area, reducing required size of result area. Update all callers to naïvely keep using result in scratch area. (ecc_mod_pow_2k, ecc_mod_pow_2k_mul): Simplified, also reducing required size of result area.
* Add separate result argument to all mod functions.Niels Möller2020-10-301-1/+1
| | | | | * ecc-internal.h (typedef ecc_mod_func): Add separate result argument. Updated all C implementations and callers.
* Merge branch 'invert-with-redc' into master-updatesNiels Möller2020-10-131-32/+8
|\
| * Make ecc modular inversion use redc form, for relevant curves.invert-with-redcNiels Möller2020-01-291-32/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | ecc: remove ecc_modp_foo/ecc_modq_foo macrosDmitry Baryshkov2020-02-151-6/+6
|/ | | | | | | To make ecc functions usage more obvious remove ecc_modp_foo() and ecc_modq_foo() wrapper macros. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* Moved internal declarations from ecc.h to ecc-internal.h.Niels Möller2015-01-271-7/+0
|
* ecc_mod_inv interface and allocation changes.Niels Möller2014-09-231-5/+2
|
* Added invert function pointer to struct ecc_modulo.Niels Möller2014-09-221-2/+2
| | | | | 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-3/+3
|
* Deleted redc function pointer.Niels Möller2014-09-221-3/+3
|
* Use struct ecc_modulo for all mod and redc functions.Niels Möller2014-09-221-3/+3
|
* Introduced struct ecc_modulo.Niels Möller2014-09-221-20/+20
|
* ecc_j_to_a interface change, optionally reduce x mod q.Niels Möller2014-08-281-15/+19
|
* Update copyright headers for dual licensing.Niels Möller2014-04-121-21/+30
|
* Fixed ECC bug with overlapping arguments to mpn_mul_n.Niels Möller2013-05-171-5/+6
|
* Changed name "Internetfonden" to "the .SE Internet Fund".Niels Möller2013-04-051-1/+1
|
* Integrate ecc_mul_g.Niels Möller2013-02-151-0/+115