summary refs log tree commit diff
path: root/crypto/src/math/ec/custom/sec/SecT233Field.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-07-18 14:04:40 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-07-18 14:04:40 +0700
commit2a27035daa92bb2fc1c89914481db58e9336d35e (patch)
tree84737dbc459344c32878722e1787fe097e766f62 /crypto/src/math/ec/custom/sec/SecT233Field.cs
parentLongArray cleanup and refactoring (diff)
downloadBouncyCastle.NET-ed25519-2a27035daa92bb2fc1c89914481db58e9336d35e.tar.xz
Factor out Unshuffle methods
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecT233Field.cs')
-rw-r--r--crypto/src/math/ec/custom/sec/SecT233Field.cs10
1 files changed, 2 insertions, 8 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecT233Field.cs b/crypto/src/math/ec/custom/sec/SecT233Field.cs
index 1ebac2eac..c16a3d612 100644
--- a/crypto/src/math/ec/custom/sec/SecT233Field.cs
+++ b/crypto/src/math/ec/custom/sec/SecT233Field.cs
@@ -151,14 +151,8 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
 
         public static void Sqrt(ulong[] x, ulong[] z)
         {
-            ulong u0, u1;
-            u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]);
-            ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32);
-            ulong c0 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL);
-
-            u0 = Interleave.Unshuffle(x[2]); u1 = Interleave.Unshuffle(x[3]);
-            ulong e1 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32);
-            ulong c1 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL);
+            ulong c0 = Interleave.Unshuffle(x[0], x[1], out ulong e0);
+            ulong c1 = Interleave.Unshuffle(x[2], x[3], out ulong e1);
 
             ulong c2;
             c2  = (c1 >> 27);