]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Prepare for assembly ecc_25519_modp.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 22 Aug 2014 17:34:05 +0000 (19:34 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 22 Aug 2014 17:34:05 +0000 (19:34 +0200)
ChangeLog
configure.ac
ecc-25519.c

index 404fd4e00a5b5420eb405f45d09cb5aeb0600ff1..a0d83c88319078082ac7856566fa8af5fd57b83f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-08-22  Niels Möller  <nisse@lysator.liu.se>
+
+       * ecc-25519.c [HAVE_NATIVE_ecc_25519_modp]: Use assembly version
+       if available.
+
+       * configure.ac (asm_hogweed_optional_list): Added ecc-25519-modp.asm.
+       Also add HAVE_NATIVE_ecc_25519_modp to config.h.in.
+
 2014-08-19  Niels Möller  <nisse@lysator.liu.se>
 
        * examples/ecc-benchmark.c (bench_curve): Support benchmarking of
index 6923d3a3514fba48e359d407f018db20f1f5e4b1..ddee35c775c2314ab28ec9084212d2d6a4bf7767 100644 (file)
@@ -285,7 +285,7 @@ asm_nettle_optional_list="gcm-hash8.asm"
 asm_hogweed_optional_list=""
 if test "x$enable_public_key" = "xyes" ; then
   asm_hogweed_optional_list="ecc-192-modp.asm ecc-224-modp.asm \
-    ecc-256-redc.asm ecc-384-modp.asm ecc-521-modp.asm"
+    ecc-25519-modp.asm ecc-256-redc.asm ecc-384-modp.asm ecc-521-modp.asm"
 fi
 
 OPT_ASM_NETTLE_SOURCES=""
@@ -365,6 +365,7 @@ AH_VERBATIM([HAVE_NATIVE],
 #undef HAVE_NATIVE_ecc_192_redc
 #undef HAVE_NATIVE_ecc_224_modp
 #undef HAVE_NATIVE_ecc_224_redc
+#undef HAVE_NATIVE_ecc_25519_modp
 #undef HAVE_NATIVE_ecc_256_modp
 #undef HAVE_NATIVE_ecc_256_redc
 #undef HAVE_NATIVE_ecc_384_modp
index e6d402f26addfae31af4567fa26a4d722fab9d73..cd6bc4bf8745cc1b5f782bc547a0bc0ecb81c7cd 100644 (file)
 
 #include "ecc-25519.h"
 
+#if HAVE_NATIVE_ecc_25519_modp
+
+#define ecc_25519_modp nettle_ecc_25519_modp
+void
+ecc_25519_modp (const struct ecc_curve *ecc, mp_limb_t *rp);
+#else
+
 #define HIGH_BITS (GMP_NUMB_BITS * ECC_LIMB_SIZE - 255)
 
 #if HIGH_BITS == 0
@@ -60,6 +67,8 @@ ecc_25519_modp(const struct ecc_curve *ecc UNUSED, mp_limb_t *rp)
     + sec_add_1 (rp, rp, ECC_LIMB_SIZE - 1, 19 * cy);
 }
 
+#endif /* HAVE_NATIVE_ecc_25519_modp */
+
 /* Needs 2*ecc->size limbs at rp, and 2*ecc->size additional limbs of
    scratch space. No overlap allowed. */
 static void