summary refs log tree commit diff
path: root/crypto/src/math/ec/custom/sec/SecP256R1Point.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecP256R1Point.cs')
-rw-r--r--crypto/src/math/ec/custom/sec/SecP256R1Point.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs
index be54e0dda..e25ff5f7a 100644
--- a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs
+++ b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs
@@ -217,12 +217,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
 
             uint[] S = Y1Squared;
             SecP256R1Field.Multiply(Y1Squared, X1.x, S);
-            SecP256R1Field.Twice(S, S);
-            SecP256R1Field.Twice(S, S);
+            uint c = Nat.ShiftUpBits(8, S, 2, 0);
+            SecP256R1Field.Reduce32(c, S);
 
-            SecP256R1Field.Twice(T, t1);
-            SecP256R1Field.Twice(t1, t1);
-            SecP256R1Field.Twice(t1, t1);
+            c = Nat.ShiftUpBits(8, T, 3, 0, t1);
+            SecP256R1Field.Reduce32(c, t1);
 
             SecP256R1FieldElement X3 = new SecP256R1FieldElement(T);
             SecP256R1Field.Square(M, X3.x);