summary refs log tree commit diff
path: root/crypto/src/math/ec/custom/sec/SecT283Field.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-07-31 17:49:43 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-07-31 17:49:43 +0700
commit89cf67c959f4080d67746946101a2375e761e039 (patch)
tree3da37f1e722e867a5e27f87e04f8bb86b16ff2b4 /crypto/src/math/ec/custom/sec/SecT283Field.cs
parentAccept only properly-sized BigInteger (no auto-reduction) (diff)
downloadBouncyCastle.NET-ed25519-89cf67c959f4080d67746946101a2375e761e039.tar.xz
Rework some of the ImplSquare methods in custom binary curves
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecT283Field.cs')
-rw-r--r--crypto/src/math/ec/custom/sec/SecT283Field.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecT283Field.cs b/crypto/src/math/ec/custom/sec/SecT283Field.cs
index 64fbc966d..ec2ba2cc1 100644
--- a/crypto/src/math/ec/custom/sec/SecT283Field.cs
+++ b/crypto/src/math/ec/custom/sec/SecT283Field.cs
@@ -390,10 +390,10 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
 
         protected static void ImplSquare(ulong[] x, ulong[] zz)
         {
-            for (int i = 0; i < 4; ++i)
-            {
-                Interleave.Expand64To128(x[i], zz, i << 1);
-            }
+            Interleave.Expand64To128(x[0], zz, 0);
+            Interleave.Expand64To128(x[1], zz, 2);
+            Interleave.Expand64To128(x[2], zz, 4);
+            Interleave.Expand64To128(x[3], zz, 6);
             zz[8] = Interleave.Expand32to64((uint)x[4]);
         }
     }