Commit ff2c93c0 authored by Niels Möller's avatar Niels Möller

New struct ecc_curve constant, edwards_root.

parent b5b6bd9b
2014-07-11 Niels Möller <nisse@lysator.liu.se>
* ecc-internal.h (struct ecc_curve): New constant edwards_root.
* ecc-192.c (nettle_secp_192r1): Updated accordingly, additional
NULL pointer.
* ecc-224.c (nettle_secp_224r1): Likewise.
* ecc-256.c (nettle_secp_256r1): Likewise.
* ecc-384.c (nettle_secp_384r1): Likewise.
* ecc-521.c (nettle_secp_521r1): Likewise.
* ecc-25519.c (nettle_curve25519): Initialize new constant.
* eccdata.c (ecc_curve_init): For curve 25519, use correct
constant for edwards coordinate transform, and output the constant
as ecc_edwards.
......
......@@ -122,6 +122,7 @@ const struct ecc_curve nettle_secp_192r1 =
ecc_q,
ecc_g,
ecc_redc_g,
NULL,
ecc_192_modp,
ecc_generic_redc,
ecc_192_modp,
......
......@@ -68,6 +68,7 @@ const struct ecc_curve nettle_secp_224r1 =
ecc_q,
ecc_g,
ecc_redc_g,
NULL,
ecc_224_modp,
ecc_generic_redc,
USE_REDC ? ecc_generic_redc : ecc_224_modp,
......
......@@ -75,6 +75,7 @@ const struct ecc_curve nettle_curve25519 =
ecc_q,
ecc_g,
ecc_redc_g,
ecc_edwards,
ecc_25519_modp,
NULL,
ecc_25519_modp,
......
......@@ -233,6 +233,7 @@ const struct ecc_curve nettle_secp_256r1 =
ecc_q,
ecc_g,
ecc_redc_g,
NULL,
ecc_256_modp,
ecc_256_redc,
USE_REDC ? ecc_256_redc : ecc_256_modp,
......
......@@ -161,6 +161,7 @@ const struct ecc_curve nettle_secp_384r1 =
ecc_q,
ecc_g,
ecc_redc_g,
NULL,
ecc_384_modp,
ECC_REDC_SIZE != 0 ? ecc_generic_redc : NULL,
ecc_384_modp,
......
......@@ -89,6 +89,7 @@ const struct ecc_curve nettle_secp_521r1 =
ecc_q,
ecc_g,
ecc_redc_g,
NULL,
ecc_521_modp,
ecc_generic_redc,
ecc_521_modp,
......
......@@ -107,6 +107,9 @@ struct ecc_curve
const mp_limb_t *g;
/* Generator with coordinates in Montgomery form. */
const mp_limb_t *redc_g;
/* If non-NULL, the constant needed for transformation to the
equivalent Edwards curve. */
const mp_limb_t *edwards_root;
ecc_mod_func *modp;
ecc_mod_func *redc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment