Commit 79a4cff0 authored by Niels Möller's avatar Niels Möller
Browse files

New ecc_curve function pointer, add_hhh.

parent 6f544435
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Compile time constant (but machine dependent) tables. Compile time constant (but machine dependent) tables.
Copyright (C) 2013 Niels Möller Copyright (C) 2013, 2014 Niels Möller
This file is part of GNU Nettle. This file is part of GNU Nettle.
...@@ -122,6 +122,7 @@ const struct ecc_curve nettle_secp_192r1 = ...@@ -122,6 +122,7 @@ const struct ecc_curve nettle_secp_192r1 =
ECC_PIPPENGER_K, ECC_PIPPENGER_K,
ECC_PIPPENGER_C, ECC_PIPPENGER_C,
ECC_ADD_JJJ_ITCH (ECC_LIMB_SIZE),
ECC_MUL_A_ITCH (ECC_LIMB_SIZE), ECC_MUL_A_ITCH (ECC_LIMB_SIZE),
ECC_MUL_G_ITCH (ECC_LIMB_SIZE), ECC_MUL_G_ITCH (ECC_LIMB_SIZE),
ECC_J_TO_A_ITCH (ECC_LIMB_SIZE), ECC_J_TO_A_ITCH (ECC_LIMB_SIZE),
...@@ -131,6 +132,7 @@ const struct ecc_curve nettle_secp_192r1 = ...@@ -131,6 +132,7 @@ const struct ecc_curve nettle_secp_192r1 =
ecc_192_modp, ecc_192_modp,
ecc_generic_modq, ecc_generic_modq,
ecc_add_jjj,
ecc_mul_a, ecc_mul_a,
ecc_mul_g, ecc_mul_g,
ecc_j_to_a, ecc_j_to_a,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Compile time constant (but machine dependent) tables. Compile time constant (but machine dependent) tables.
Copyright (C) 2013 Niels Möller Copyright (C) 2013, 2014 Niels Möller
This file is part of GNU Nettle. This file is part of GNU Nettle.
...@@ -74,6 +74,7 @@ const struct ecc_curve nettle_secp_224r1 = ...@@ -74,6 +74,7 @@ const struct ecc_curve nettle_secp_224r1 =
ECC_PIPPENGER_K, ECC_PIPPENGER_K,
ECC_PIPPENGER_C, ECC_PIPPENGER_C,
ECC_ADD_JJJ_ITCH (ECC_LIMB_SIZE),
ECC_MUL_A_ITCH (ECC_LIMB_SIZE), ECC_MUL_A_ITCH (ECC_LIMB_SIZE),
ECC_MUL_G_ITCH (ECC_LIMB_SIZE), ECC_MUL_G_ITCH (ECC_LIMB_SIZE),
ECC_J_TO_A_ITCH (ECC_LIMB_SIZE), ECC_J_TO_A_ITCH (ECC_LIMB_SIZE),
...@@ -83,6 +84,7 @@ const struct ecc_curve nettle_secp_224r1 = ...@@ -83,6 +84,7 @@ const struct ecc_curve nettle_secp_224r1 =
USE_REDC ? ecc_224_redc : ecc_224_modp, USE_REDC ? ecc_224_redc : ecc_224_modp,
ecc_generic_modq, ecc_generic_modq,
ecc_add_jjj,
ecc_mul_a, ecc_mul_a,
ecc_mul_g, ecc_mul_g,
ecc_j_to_a, ecc_j_to_a,
......
...@@ -242,6 +242,7 @@ const struct ecc_curve nettle_curve25519 = ...@@ -242,6 +242,7 @@ const struct ecc_curve nettle_curve25519 =
ECC_PIPPENGER_K, ECC_PIPPENGER_K,
ECC_PIPPENGER_C, ECC_PIPPENGER_C,
ECC_ADD_EHH_ITCH (ECC_LIMB_SIZE),
ECC_MUL_A_EH_ITCH (ECC_LIMB_SIZE), ECC_MUL_A_EH_ITCH (ECC_LIMB_SIZE),
ECC_MUL_G_EH_ITCH (ECC_LIMB_SIZE), ECC_MUL_G_EH_ITCH (ECC_LIMB_SIZE),
ECC_EH_TO_A_ITCH (ECC_LIMB_SIZE), ECC_EH_TO_A_ITCH (ECC_LIMB_SIZE),
...@@ -251,7 +252,7 @@ const struct ecc_curve nettle_curve25519 = ...@@ -251,7 +252,7 @@ const struct ecc_curve nettle_curve25519 =
ecc_25519_modp, ecc_25519_modp,
ecc_25519_modq, ecc_25519_modq,
ecc_add_ehh,
ecc_mul_a_eh, ecc_mul_a_eh,
ecc_mul_g_eh, ecc_mul_g_eh,
ecc_eh_to_a, ecc_eh_to_a,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Compile time constant (but machine dependent) tables. Compile time constant (but machine dependent) tables.
Copyright (C) 2013 Niels Möller Copyright (C) 2013, 2014 Niels Möller
This file is part of GNU Nettle. This file is part of GNU Nettle.
...@@ -237,6 +237,7 @@ const struct ecc_curve nettle_secp_256r1 = ...@@ -237,6 +237,7 @@ const struct ecc_curve nettle_secp_256r1 =
ECC_PIPPENGER_K, ECC_PIPPENGER_K,
ECC_PIPPENGER_C, ECC_PIPPENGER_C,
ECC_ADD_JJJ_ITCH (ECC_LIMB_SIZE),
ECC_MUL_A_ITCH (ECC_LIMB_SIZE), ECC_MUL_A_ITCH (ECC_LIMB_SIZE),
ECC_MUL_G_ITCH (ECC_LIMB_SIZE), ECC_MUL_G_ITCH (ECC_LIMB_SIZE),
ECC_J_TO_A_ITCH (ECC_LIMB_SIZE), ECC_J_TO_A_ITCH (ECC_LIMB_SIZE),
...@@ -246,6 +247,7 @@ const struct ecc_curve nettle_secp_256r1 = ...@@ -246,6 +247,7 @@ const struct ecc_curve nettle_secp_256r1 =
USE_REDC ? ecc_256_redc : ecc_256_modp, USE_REDC ? ecc_256_redc : ecc_256_modp,
ecc_256_modq, ecc_256_modq,
ecc_add_jjj,
ecc_mul_a, ecc_mul_a,
ecc_mul_g, ecc_mul_g,
ecc_j_to_a, ecc_j_to_a,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Compile time constant (but machine dependent) tables. Compile time constant (but machine dependent) tables.
Copyright (C) 2013 Niels Möller Copyright (C) 2013, 2014 Niels Möller
This file is part of GNU Nettle. This file is part of GNU Nettle.
...@@ -159,6 +159,7 @@ const struct ecc_curve nettle_secp_384r1 = ...@@ -159,6 +159,7 @@ const struct ecc_curve nettle_secp_384r1 =
ECC_PIPPENGER_K, ECC_PIPPENGER_K,
ECC_PIPPENGER_C, ECC_PIPPENGER_C,
ECC_ADD_JJJ_ITCH (ECC_LIMB_SIZE),
ECC_MUL_A_ITCH (ECC_LIMB_SIZE), ECC_MUL_A_ITCH (ECC_LIMB_SIZE),
ECC_MUL_G_ITCH (ECC_LIMB_SIZE), ECC_MUL_G_ITCH (ECC_LIMB_SIZE),
ECC_J_TO_A_ITCH (ECC_LIMB_SIZE), ECC_J_TO_A_ITCH (ECC_LIMB_SIZE),
...@@ -168,6 +169,7 @@ const struct ecc_curve nettle_secp_384r1 = ...@@ -168,6 +169,7 @@ const struct ecc_curve nettle_secp_384r1 =
ecc_384_modp, ecc_384_modp,
ecc_generic_modq, ecc_generic_modq,
ecc_add_jjj,
ecc_mul_a, ecc_mul_a,
ecc_mul_g, ecc_mul_g,
ecc_j_to_a, ecc_j_to_a,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Compile time constant (but machine dependent) tables. Compile time constant (but machine dependent) tables.
Copyright (C) 2013 Niels Möller Copyright (C) 2013, 2014 Niels Möller
This file is part of GNU Nettle. This file is part of GNU Nettle.
...@@ -87,6 +87,7 @@ const struct ecc_curve nettle_secp_521r1 = ...@@ -87,6 +87,7 @@ const struct ecc_curve nettle_secp_521r1 =
ECC_PIPPENGER_K, ECC_PIPPENGER_K,
ECC_PIPPENGER_C, ECC_PIPPENGER_C,
ECC_ADD_JJJ_ITCH (ECC_LIMB_SIZE),
ECC_MUL_A_ITCH (ECC_LIMB_SIZE), ECC_MUL_A_ITCH (ECC_LIMB_SIZE),
ECC_MUL_G_ITCH (ECC_LIMB_SIZE), ECC_MUL_G_ITCH (ECC_LIMB_SIZE),
ECC_J_TO_A_ITCH (ECC_LIMB_SIZE), ECC_J_TO_A_ITCH (ECC_LIMB_SIZE),
...@@ -96,6 +97,7 @@ const struct ecc_curve nettle_secp_521r1 = ...@@ -96,6 +97,7 @@ const struct ecc_curve nettle_secp_521r1 =
ecc_521_modp, ecc_521_modp,
ecc_generic_modq, ecc_generic_modq,
ecc_add_jjj,
ecc_mul_a, ecc_mul_a,
ecc_mul_g, ecc_mul_g,
ecc_j_to_a, ecc_j_to_a,
......
/* ecc-internal.h /* ecc-internal.h
Copyright (C) 2013 Niels Möller Copyright (C) 2013, 2014 Niels Möller
This file is part of GNU Nettle. This file is part of GNU Nettle.
...@@ -82,6 +82,11 @@ ...@@ -82,6 +82,11 @@
modp_mul and modp_add. */ modp_mul and modp_add. */
typedef void ecc_mod_func (const struct ecc_curve *ecc, mp_limb_t *rp); typedef void ecc_mod_func (const struct ecc_curve *ecc, mp_limb_t *rp);
typedef void ecc_add_func (const struct ecc_curve *ecc,
mp_limb_t *r,
const mp_limb_t *p, const mp_limb_t *q,
mp_limb_t *scratch);
typedef void ecc_mul_g_func (const struct ecc_curve *ecc, mp_limb_t *r, typedef void ecc_mul_g_func (const struct ecc_curve *ecc, mp_limb_t *r,
const mp_limb_t *np, mp_limb_t *scratch); const mp_limb_t *np, mp_limb_t *scratch);
...@@ -116,6 +121,7 @@ struct ecc_curve ...@@ -116,6 +121,7 @@ struct ecc_curve
unsigned short pippenger_k; unsigned short pippenger_k;
unsigned short pippenger_c; unsigned short pippenger_c;
unsigned short add_hhh_itch;
unsigned short mul_itch; unsigned short mul_itch;
unsigned short mul_g_itch; unsigned short mul_g_itch;
unsigned short h_to_a_itch; unsigned short h_to_a_itch;
...@@ -125,6 +131,7 @@ struct ecc_curve ...@@ -125,6 +131,7 @@ struct ecc_curve
ecc_mod_func *reduce; ecc_mod_func *reduce;
ecc_mod_func *modq; ecc_mod_func *modq;
ecc_add_func *add_hhh;
ecc_mul_func *mul; ecc_mul_func *mul;
ecc_mul_g_func *mul_g; ecc_mul_g_func *mul_g;
ecc_h_to_a_func *h_to_a; ecc_h_to_a_func *h_to_a;
......
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