Make sure memcpy() is properly declared by including string.h.
[openssl.git] / crypto / ec / ec_mult.c
index 42cd98181c096039a4b93acc5a4d3ea6d5e61a71..f4e5f90847114ee511f35cb457544608e5ae35ce 100644 (file)
@@ -61,6 +61,8 @@
  * and contributed to the OpenSSL project.
  */
 
+#include <string.h>
+
 #include <openssl/err.h>
 
 #include "ec_lcl.h"
@@ -767,8 +769,6 @@ int ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
                if ((pre_comp = new_pre_comp = ec_pre_comp_new(group)) == NULL)
                        return 0;
 
-CRYPTO_push_info("ec_wNAF_precompute_mult");
-
        generator = EC_GROUP_get0_generator(group);
        if (generator == NULL)
                {
@@ -795,6 +795,13 @@ CRYPTO_push_info("ec_wNAF_precompute_mult");
                }
 
        bits = BN_num_bits(order);
+       /* The following parameters mean we precompute (approximately)
+        * one point per bit.
+        *
+        * TBD: The combination  8, 4  is perfect for 160 bits; for other
+        * bit lengths, other parameter combinations might provide better
+        * efficiency.
+        */
        blocksize = 8;
        w = 4;
        if (EC_window_bits_for_scalar_size(bits) > w)
@@ -902,8 +909,6 @@ CRYPTO_push_info("ec_wNAF_precompute_mult");
 
        ret = 1;
  err:
-       CRYPTO_pop_info();
-
        BN_CTX_end(ctx);
        if (new_ctx != NULL)
                BN_CTX_free(new_ctx);