summary refs log tree commit diff
path: root/crypto/src/math/ec/ECFieldElement.cs
diff options
context:
space:
mode:
authorDavid Hook <david.hook@keyfactor.com>2022-11-07 17:30:00 +1100
committerDavid Hook <david.hook@keyfactor.com>2022-11-07 17:30:00 +1100
commit146be77300207031b6b9477b8e48428278e841b8 (patch)
treed7342aad04bca424b56229d1d5eba558bbb4afd3 /crypto/src/math/ec/ECFieldElement.cs
parentresolve conflicts (diff)
parentGOST 2012 private key reading (diff)
downloadBouncyCastle.NET-ed25519-146be77300207031b6b9477b8e48428278e841b8.tar.xz
Merge branch 'master' of gitlab.cryptoworkshop.com:root/bc-csharp
Diffstat (limited to 'crypto/src/math/ec/ECFieldElement.cs')
-rw-r--r--crypto/src/math/ec/ECFieldElement.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/math/ec/ECFieldElement.cs b/crypto/src/math/ec/ECFieldElement.cs
index 330708088..3afc843cd 100644
--- a/crypto/src/math/ec/ECFieldElement.cs
+++ b/crypto/src/math/ec/ECFieldElement.cs
@@ -785,9 +785,9 @@ namespace Org.BouncyCastle.Math.EC
             LongArray ab = ax.Multiply(bx, m, ks);
             LongArray xy = xx.Multiply(yx, m, ks);
 
-            if (ab == ax || ab == bx)
+            if (LongArray.AreAliased(ref ab, ref ax) || LongArray.AreAliased(ref ab, ref bx))
             {
-                ab = (LongArray)ab.Copy();
+                ab = ab.Copy();
             }
 
             ab.AddShiftedByWords(xy, 0);
@@ -827,9 +827,9 @@ namespace Org.BouncyCastle.Math.EC
             LongArray aa = ax.Square(m, ks);
             LongArray xy = xx.Multiply(yx, m, ks);
 
-            if (aa == ax)
+            if (LongArray.AreAliased(ref aa, ref ax))
             {
-                aa = (LongArray)aa.Copy();
+                aa = aa.Copy();
             }
 
             aa.AddShiftedByWords(xy, 0);