summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-03-12 17:49:45 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-03-12 17:49:45 +0700
commit133047d6140d2b5b9e5532309594fa980af9bc36 (patch)
tree697e703c882589adf3963a89fb2194a210d00d9a
parentAdd new method (diff)
downloadBouncyCastle.NET-ed25519-133047d6140d2b5b9e5532309594fa980af9bc36.tar.xz
Weight the performance test more towards random points
-rw-r--r--crypto/test/src/math/ec/test/ECPointPerformanceTest.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs b/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs
index 72ab839b3..daa08c219 100644
--- a/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs
+++ b/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs
@@ -25,7 +25,7 @@ namespace Org.BouncyCastle.Math.EC.Tests
     public class ECPointPerformanceTest
     {
         internal const int MULTS_PER_ROUND = 100;
-        internal const int PRE_ROUNDS = 1;
+        internal const int PRE_ROUNDS = 2;
         internal const int NUM_ROUNDS = 10;
 
         private static string[] COORD_NAMES = new string[]{ "AFFINE", "HOMOGENEOUS", "JACOBIAN", "JACOBIAN-CHUDNOVSKY",
@@ -105,10 +105,13 @@ namespace Org.BouncyCastle.Math.EC.Tests
                 {
                     BigInteger k = ks[ki];
                     p = g.Multiply(k);
+                    if ((ki & 1) != 0)
+                    {
+                        g = p;
+                    }
                     if (++ki == ks.Length)
                     {
                         ki = 0;
-                        g = p;
                     }
                 }
             }
@@ -123,10 +126,13 @@ namespace Org.BouncyCastle.Math.EC.Tests
                 {
                     BigInteger k = ks[ki];
                     p = g.Multiply(k);
+                    if ((ki & 1) != 0)
+                    {
+                        g = p;
+                    }
                     if (++ki == ks.Length)
                     {
                         ki = 0;
-                        g = p;
                     }
                 }