summary refs log tree commit diff
path: root/crypto/src/math/ec/ECAlgorithms.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-02-04 02:17:04 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-02-04 02:17:04 +0700
commit7610f647360313aa86d89884c45ce6d334876b73 (patch)
treeb01a0b682c5064cae4b5e1f075089410edfbfdbe /crypto/src/math/ec/ECAlgorithms.cs
parentUpdate IPAddress from bc-java (diff)
downloadBouncyCastle.NET-ed25519-7610f647360313aa86d89884c45ce6d334876b73.tar.xz
Misc. refactoring after bc-fips-csharp updates
Diffstat (limited to 'crypto/src/math/ec/ECAlgorithms.cs')
-rw-r--r--crypto/src/math/ec/ECAlgorithms.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/src/math/ec/ECAlgorithms.cs b/crypto/src/math/ec/ECAlgorithms.cs
index e7a7189b7..7b04fb56e 100644
--- a/crypto/src/math/ec/ECAlgorithms.cs
+++ b/crypto/src/math/ec/ECAlgorithms.cs
@@ -584,12 +584,11 @@ namespace Org.BouncyCastle.Math.EC
 
             ECPoint R = c.Infinity;
 
-            int top = fullComb - 1; 
-            for (int i = 0; i < d; ++i)
+            for (int i = 1; i <= d; ++i)
             {
                 uint secretIndexK = 0, secretIndexL = 0;
 
-                for (int j = top - i; j >= 0; j -= d)
+                for (int j = fullComb - i; j >= 0; j -= d)
                 {
                     uint secretBitK = K[j >> 5] >> (j & 0x1F);
                     secretIndexK ^= secretBitK >> 1;