]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Use add_hh rather than add_hhh for ecc_mul_a_eh.
authorNiels Möller <nisse@lysator.liu.se>
Wed, 25 Dec 2019 10:33:08 +0000 (11:33 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 25 Dec 2019 10:33:08 +0000 (11:33 +0100)
* ecc-mul-a-eh.c (ecc_mul_a_eh) [ECC_MUL_A_EH_WBITS == 0]: Use
add_hh rather than add_hhh.
(table_init) [[ECC_MUL_A_EH_WBITS > 0]: Likewise.
* ecc-internal.h (ECC_MUL_A_EH_ITCH) [ECC_MUL_A_EH_WBITS == 0]:
Reduced from 13*n to 12*n.

ChangeLog
ecc-internal.h
ecc-mul-a-eh.c

index f463c5f71d66a4bf5846c262c47235c3e7fb693e..a35dcdda8d7ef24fae382523e3dd69f8040bd349 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-12-19  Niels Möller  <nisse@lysator.liu.se>
+
+       * ecc-mul-a-eh.c (ecc_mul_a_eh) [ECC_MUL_A_EH_WBITS == 0]: Use
+       add_hh rather than add_hhh.
+       (table_init) [[ECC_MUL_A_EH_WBITS > 0]: Likewise.
+       * ecc-internal.h (ECC_MUL_A_EH_ITCH) [ECC_MUL_A_EH_WBITS == 0]:
+       Reduced from 13*n to 12*n.
+
 2019-12-18  Niels Möller  <nisse@lysator.liu.se>
 
        Rename add and dup functions for Edwards curves.
index 000b812ec0f29d735080eecfac81a0532644c4e8..99ae3d3d27600382456ffcbc3dfef8ad4b02daf5 100644 (file)
@@ -445,7 +445,7 @@ curve448_eh_to_x (mp_limb_t *xp, const mp_limb_t *p,
   (((3 << ECC_MUL_A_WBITS) + 11) * (size))
 #endif
 #if ECC_MUL_A_EH_WBITS == 0
-#define ECC_MUL_A_EH_ITCH(size) (13*(size))
+#define ECC_MUL_A_EH_ITCH(size) (12*(size))
 #else
 #define ECC_MUL_A_EH_ITCH(size) \
   (((3 << ECC_MUL_A_EH_WBITS) + 10) * (size))
index e9b22cd4c1e702eac9584948924b9714c1020735..d7765ebfe9300b0ded290807a802ede7cbca2072 100644 (file)
@@ -39,7 +39,7 @@
 #include "ecc-internal.h"
 
 /* Binary algorithm needs 6*ecc->p.size + scratch for ecc_add_ehh,
-   total 13 ecc->p.size
+   total 12 ecc->p.size
 
    Window algorithm needs (3<<w) * ecc->p.size for the table,
    3*ecc->p.size for a temporary point, and scratch for
@@ -76,7 +76,7 @@ ecc_mul_a_eh (const struct ecc_curve *ecc,
          int digit;
 
          ecc->dup (ecc, r, r, scratch_out);
-         ecc->add_hhh (ecc, tp, r, pe, scratch_out);
+         ecc->add_hh (ecc, tp, r, pe, scratch_out);
 
          digit = (w & bit) > 0;
          /* If we had a one-bit, use the sum. */
@@ -108,7 +108,7 @@ table_init (const struct ecc_curve *ecc,
   for (j = 2; j < size; j += 2)
     {
       ecc->dup (ecc, TABLE(j), TABLE(j/2), scratch);
-      ecc->add_hhh (ecc, TABLE(j+1), TABLE(j), TABLE(1), scratch);
+      ecc->add_hh (ecc, TABLE(j+1), TABLE(j), TABLE(1), scratch);
     }
 }