diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-03-12 17:49:45 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-03-12 17:49:45 +0700 |
commit | 133047d6140d2b5b9e5532309594fa980af9bc36 (patch) | |
tree | 697e703c882589adf3963a89fb2194a210d00d9a /crypto/test | |
parent | Add new method (diff) | |
download | BouncyCastle.NET-ed25519-133047d6140d2b5b9e5532309594fa980af9bc36.tar.xz |
Weight the performance test more towards random points
Diffstat (limited to 'crypto/test')
-rw-r--r-- | crypto/test/src/math/ec/test/ECPointPerformanceTest.cs | 12 |
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; } } |