summary refs log tree commit diff
path: root/crypto/src/math/ec/custom/sec/SecP224R1Field.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-03-06 10:54:16 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-03-06 10:54:16 +0700
commit974c5178fc0b4ffbdd0aed7c3c24d646b0e1af74 (patch)
tree3af64e57a23bd5845102be9b43edbc7ab6f17f8d /crypto/src/math/ec/custom/sec/SecP224R1Field.cs
parentAvoid redundant subtraction (diff)
downloadBouncyCastle.NET-ed25519-974c5178fc0b4ffbdd0aed7c3c24d646b0e1af74.tar.xz
Minor improvement to reduction release-1.8.0-beta.2
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecP224R1Field.cs')
-rw-r--r--crypto/src/math/ec/custom/sec/SecP224R1Field.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs
index 712d6a46d..3f9f79fc3 100644
--- a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs
+++ b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs
@@ -97,8 +97,10 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
 
             const long n = 1;
 
+            t0 -= n;
+
             long cc = 0;
-            cc += (long)xx[0] - t0 + n;
+            cc += (long)xx[0] - t0;
             z[0] = (uint)cc;
             cc >>= 32;
             cc += (long)xx[1] - t1;
@@ -107,7 +109,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
             cc += (long)xx[2] - t2;
             z[2] = (uint)cc;
             cc >>= 32;
-            cc += (long)xx[3] + t0 - xx10 - n;
+            cc += (long)xx[3] + t0 - xx10;
             z[3] = (uint)cc;
             cc >>= 32;
             cc += (long)xx[4] + t1 - xx11;