]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Reordered struct ecc_curve, moved function pointers before pointers to bignum constants.
authorNiels Möller <nisse@lysator.liu.se>
Sat, 23 Aug 2014 21:02:17 +0000 (23:02 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Sat, 23 Aug 2014 21:02:17 +0000 (23:02 +0200)
ChangeLog
ecc-192.c
ecc-224.c
ecc-25519.c
ecc-256.c
ecc-384.c
ecc-521.c
ecc-internal.h

index a4e89d42cdc933b081d20829b3ec5295d8a19970..31dc3b1e62f7903ed5b23152961a056e9025f49f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-08-23  Niels Möller  <nisse@lysator.liu.se>
 
+       * ecc-internal.h (struct ecc_curve): Reordered struct, moved
+       function pointers before pointers to bignum constants.
+
        * sec-modinv.c (sec_modinv): Document that for a == 0 (mod m), we
        should produce the "inverse" 0.
 
index ee898b11fd01bd8a1149ac77da3fab7c926f2598..fe624dee128503ae2b54512f111acb7f86ee0ad6 100644 (file)
--- a/ecc-192.c
+++ b/ecc-192.c
@@ -117,16 +117,18 @@ const struct ecc_curve nettle_secp_192r1 =
   ECC_REDC_SIZE,
   ECC_PIPPENGER_K,
   ECC_PIPPENGER_C,
+
+  ecc_192_modp,
+  ecc_generic_redc,
+  ecc_192_modp,
+  ecc_generic_modq,
+
   ecc_p,
   ecc_b,
   ecc_q,
   ecc_g,
   ecc_redc_g,
   NULL,
-  ecc_192_modp,
-  ecc_generic_redc,
-  ecc_192_modp,
-  ecc_generic_modq,
   ecc_Bmodp,
   ecc_Bmodp_shifted,
   ecc_pp1h,
index 15abb2480c31ce7d72c9180d0fbcf5fb58ce4035..fb3e4d5fa37c71fd26be4c02a2d52e6fb91692f0 100644 (file)
--- a/ecc-224.c
+++ b/ecc-224.c
@@ -63,16 +63,18 @@ const struct ecc_curve nettle_secp_224r1 =
   ECC_REDC_SIZE,
   ECC_PIPPENGER_K,
   ECC_PIPPENGER_C,
+
+  ecc_224_modp,
+  ecc_generic_redc,
+  USE_REDC ? ecc_generic_redc : ecc_224_modp,
+  ecc_generic_modq,
+
   ecc_p,
   ecc_b,
   ecc_q,
   ecc_g,
   ecc_redc_g,
   NULL,
-  ecc_224_modp,
-  ecc_generic_redc,
-  USE_REDC ? ecc_generic_redc : ecc_224_modp,
-  ecc_generic_modq,
   ecc_Bmodp,
   ecc_Bmodp_shifted,
   ecc_pp1h,
index cd6bc4bf8745cc1b5f782bc547a0bc0ecb81c7cd..5b3a7468cc63cc68ff0ab77ea31aa02fc93db2ed 100644 (file)
@@ -209,16 +209,18 @@ const struct ecc_curve nettle_curve25519 =
   0,
   ECC_PIPPENGER_K,
   ECC_PIPPENGER_C,
+
+  ecc_25519_modp,
+  NULL,
+  ecc_25519_modp,
+  NULL,
+
   ecc_p,
   ecc_d, /* Use the Edwards curve constant. */
   ecc_q,
   ecc_g,
   ecc_redc_g,
   ecc_edwards,
-  ecc_25519_modp,
-  NULL,
-  ecc_25519_modp,
-  NULL,
   ecc_Bmodp,
   ecc_Bmodp_shifted,
   ecc_pp1h,
index 506c9afad7c8bb3a6c62434aae6b895e3ab36097..2ded5b3bde94aa70dc856f303cd48be8920a6367 100644 (file)
--- a/ecc-256.c
+++ b/ecc-256.c
@@ -228,16 +228,18 @@ const struct ecc_curve nettle_secp_256r1 =
   ECC_REDC_SIZE,
   ECC_PIPPENGER_K,
   ECC_PIPPENGER_C,
+
+  ecc_256_modp,
+  ecc_256_redc,
+  USE_REDC ? ecc_256_redc : ecc_256_modp,
+  ecc_256_modq,
+
   ecc_p,
   ecc_b,
   ecc_q,
   ecc_g,
   ecc_redc_g,
   NULL,
-  ecc_256_modp,
-  ecc_256_redc,
-  USE_REDC ? ecc_256_redc : ecc_256_modp,
-  ecc_256_modq,
   ecc_Bmodp,
   ecc_Bmodp_shifted,
   ecc_pp1h,
index e5ec87e57489aa6227d13db0514d5b627d6e6606..dff0cd015de2cbe9162551231cd9b4ac7ab1fa2f 100644 (file)
--- a/ecc-384.c
+++ b/ecc-384.c
@@ -156,16 +156,18 @@ const struct ecc_curve nettle_secp_384r1 =
   ECC_REDC_SIZE,
   ECC_PIPPENGER_K,
   ECC_PIPPENGER_C,
+
+  ecc_384_modp,
+  ECC_REDC_SIZE != 0 ? ecc_generic_redc : NULL,
+  ecc_384_modp,
+  ecc_generic_modq,
+
   ecc_p,
   ecc_b,
   ecc_q,
   ecc_g,
   ecc_redc_g,
   NULL,
-  ecc_384_modp,
-  ECC_REDC_SIZE != 0 ? ecc_generic_redc : NULL,
-  ecc_384_modp,
-  ecc_generic_modq,
   ecc_Bmodp,
   ecc_Bmodp_shifted,
   ecc_pp1h,
index 821c9645689b08366d02c7001237539d97a3fe4b..25fc2b08340ce9a74aa86c815d0724d2ff866da5 100644 (file)
--- a/ecc-521.c
+++ b/ecc-521.c
@@ -84,16 +84,18 @@ const struct ecc_curve nettle_secp_521r1 =
   ECC_REDC_SIZE,
   ECC_PIPPENGER_K,
   ECC_PIPPENGER_C,
+
+  ecc_521_modp,
+  ecc_generic_redc,
+  ecc_521_modp,
+  ecc_generic_modq,
+
   ecc_p,
   ecc_b,
   ecc_q,
   ecc_g,
   ecc_redc_g,
   NULL,
-  ecc_521_modp,
-  ecc_generic_redc,
-  ecc_521_modp,
-  ecc_generic_modq,
   ecc_Bmodp,
   ecc_Bmodp_shifted,
   ecc_pp1h,
index 2589eb608cb5604e46afc687372595a153e28c9e..d180122b4d45d299fccc2cb0d09b97f298a3d380 100644 (file)
@@ -102,6 +102,11 @@ struct ecc_curve
   unsigned short pippenger_k;
   unsigned short pippenger_c;
 
+  ecc_mod_func *modp;
+  ecc_mod_func *redc;
+  ecc_mod_func *reduce;
+  ecc_mod_func *modq;
+  
   /* The prime p. */
   const mp_limb_t *p;
   const mp_limb_t *b;
@@ -115,11 +120,6 @@ struct ecc_curve
      equivalent Edwards curve. */
   const mp_limb_t *edwards_root;
 
-  ecc_mod_func *modp;
-  ecc_mod_func *redc;
-  ecc_mod_func *reduce;
-  ecc_mod_func *modq;
-
   /* B^size mod p. Expected to have at least 32 leading zeros
      (equality for secp_256r1). */
   const mp_limb_t *Bmodp;