implement fast point multiplication with precomputation
[openssl.git] / apps / speed.c
index ad455e5073882fab1f6c8b31278aca12ced120a8..d6f78fb5d4a2cb99744187655b1926a558b15a06 100644 (file)
@@ -398,7 +398,9 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
 
 int MAIN(int argc, char **argv)
        {
+#ifndef OPENSSL_NO_ENGINE
        ENGINE *e = NULL;
        ENGINE *e = NULL;
+#endif
        unsigned char *buf=NULL,*buf2=NULL;
        int mret=1;
        long count=0,save_count=0;
        unsigned char *buf=NULL,*buf2=NULL;
        int mret=1;
        long count=0,save_count=0;
@@ -731,6 +733,7 @@ int MAIN(int argc, char **argv)
                        j--;    /* Otherwise, -elapsed gets confused with
                                   an algorithm. */
                        }
                        j--;    /* Otherwise, -elapsed gets confused with
                                   an algorithm. */
                        }
+#ifndef OPENSSL_NO_ENGINE
                else if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
                        {
                        argc--;
                else if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
                        {
                        argc--;
@@ -747,6 +750,7 @@ int MAIN(int argc, char **argv)
                           means all of them should be run) */
                        j--;
                        }
                           means all of them should be run) */
                        j--;
                        }
+#endif
 #ifdef HAVE_FORK
                else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
                        {
 #ifdef HAVE_FORK
                else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
                        {
@@ -1064,7 +1068,9 @@ int MAIN(int argc, char **argv)
 #if defined(TIMES) || defined(USE_TOD)
                        BIO_printf(bio_err,"-elapsed        measure time in real time instead of CPU user time.\n");
 #endif
 #if defined(TIMES) || defined(USE_TOD)
                        BIO_printf(bio_err,"-elapsed        measure time in real time instead of CPU user time.\n");
 #endif
+#ifndef OPENSSL_NO_ENGINE
                        BIO_printf(bio_err,"-engine e       use engine e, possibly a hardware device.\n");
                        BIO_printf(bio_err,"-engine e       use engine e, possibly a hardware device.\n");
+#endif
                        BIO_printf(bio_err,"-evp e          use EVP e.\n");
                        BIO_printf(bio_err,"-decrypt        time decryption instead of encryption (only EVP).\n");
                        BIO_printf(bio_err,"-mr             produce machine readable output.\n");
                        BIO_printf(bio_err,"-evp e          use EVP e.\n");
                        BIO_printf(bio_err,"-decrypt        time decryption instead of encryption (only EVP).\n");
                        BIO_printf(bio_err,"-mr             produce machine readable output.\n");
@@ -1927,6 +1933,9 @@ int MAIN(int argc, char **argv)
                                } 
                        else 
                                {
                                } 
                        else 
                                {
+#if 1
+                               EC_GROUP_precompute_mult(ecdsa[j]->group, NULL);
+#endif
                                /* Perform ECDSA signature test */
                                EC_KEY_generate_key(ecdsa[j]);
                                ret = ECDSA_sign(0, buf, 20, ecdsasig, 
                                /* Perform ECDSA signature test */
                                EC_KEY_generate_key(ecdsa[j]);
                                ret = ECDSA_sign(0, buf, 20, ecdsasig,