summary refs log tree commit diff
path: root/crypto/src/math/ec/custom/sec/SecP384R1Field.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2016-02-02 18:09:16 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2016-02-02 18:09:16 +0700
commit745143a518d71a026e142007b6a4bc831e2ae13b (patch)
tree3af4cc8143e8c2c2f85816443a0284e58d4baef6 /crypto/src/math/ec/custom/sec/SecP384R1Field.cs
parentJust check the final ReadByte return value (diff)
downloadBouncyCastle.NET-ed25519-745143a518d71a026e142007b6a4bc831e2ae13b.tar.xz
Additional temp values in reduction
Diffstat (limited to '')
-rw-r--r--crypto/src/math/ec/custom/sec/SecP384R1Field.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecP384R1Field.cs b/crypto/src/math/ec/custom/sec/SecP384R1Field.cs
index 7820775ee..0780df3f0 100644
--- a/crypto/src/math/ec/custom/sec/SecP384R1Field.cs
+++ b/crypto/src/math/ec/custom/sec/SecP384R1Field.cs
@@ -105,9 +105,10 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
             long t4 = xx17 + xx21;
             long t5 = xx21 - xx23;
             long t6 = xx22 - xx23;
+            long t7 = t0 + t5;
 
             long cc = 0;
-            cc += (long)xx[0] + t0 + t5;
+            cc += (long)xx[0] + t7;
             z[0] = (uint)cc;
             cc >>= 32;
             cc += (long)xx[1] + xx23 - t0 + t1;
@@ -116,10 +117,10 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
             cc += (long)xx[2] - xx21 - t1 + t2;
             z[2] = (uint)cc;
             cc >>= 32;
-            cc += (long)xx[3] + t0 - t2 + t3 + t5;
+            cc += (long)xx[3] - t2 + t3 + t7;
             z[3] = (uint)cc;
             cc >>= 32;
-            cc += (long)xx[4] + xx16 + xx21 + t0 + t1 - t3 + t5;
+            cc += (long)xx[4] + xx16 + xx21 + t1 - t3 + t7;
             z[4] = (uint)cc;
             cc >>= 32;
             cc += (long)xx[5] - xx16 + t1 + t2 + t4;