From 133047d6140d2b5b9e5532309594fa980af9bc36 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 12 Mar 2014 17:49:45 +0700 Subject: Weight the performance test more towards random points --- crypto/test/src/math/ec/test/ECPointPerformanceTest.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crypto/test') 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; } } -- cgit 1.5.1