Commit 25480d57b73f45f44d2e9005514c46347d62c9d0

Steffen Jaeckel 2015-04-26T16:58:36

demo: test one big montgomery reduction ...only for coverage reasons...

diff --git a/demo/demo.c b/demo/demo.c
index f1ab899..75d5cf8 100644
--- a/demo/demo.c
+++ b/demo/demo.c
@@ -187,7 +187,9 @@ int main(void)
 
    // test montgomery
    printf("Testing: montgomery...\n");
-   for (i = 1; i < 10; i++) {
+   for (i = 1; i <= 10; i++) {
+      if (i == 10)
+         i = 1000;
       printf(" digit size: %2d\r", i);
       fflush(stdout);
       for (n = 0; n < 1000; n++) {
@@ -215,6 +217,12 @@ mp_todecimal(&e, buf); printf("e = %s\n", buf);
 mp_todecimal(&d, buf); printf("d = %s\n", buf);
 mp_todecimal(&c, buf); printf("c = %s\n", buf);
 printf("compare no compare!\n"); return EXIT_FAILURE; }
+             /* only one big montgomery reduction */
+             if (i > 10)
+             {
+                n = 1000;
+                ix = 100;
+             }
          }
       }
    }