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-10 13:51:28 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-03-10 13:51:28 +0700
commit44da462ba03951c22b1fa552f4d74b1a69882197 (patch)
tree15c0c88305e64b0e192d0f61053b1c8c50d26374 /crypto/src/math/ec/custom/sec/SecP224R1Field.cs
parentInline Reduce32 calls and registerize some values to avoid extra writes (diff)
downloadBouncyCastle.NET-ed25519-44da462ba03951c22b1fa552f4d74b1a69882197.tar.xz
Refactor temporary variables in reductions
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecP224R1Field.cs')
-rw-r--r--crypto/src/math/ec/custom/sec/SecP224R1Field.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs
index 17c9b92a5..51d9020b6 100644
--- a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs
+++ b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs
@@ -88,16 +88,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec
 
         public static void Reduce(uint[] xx, uint[] z)
         {
-            long xx07 = xx[7], xx08 = xx[8], xx09 = xx[9], xx10 = xx[10];
-            long xx11 = xx[11], xx12 = xx[12], xx13 = xx[13];
-
-            long t0 = xx07 + xx11;
-            long t1 = xx08 + xx12;
-            long t2 = xx09 + xx13;
+            long xx10 = xx[10], xx11 = xx[11], xx12 = xx[12], xx13 = xx[13];
 
             const long n = 1;
 
-            t0 -= n;
+            long t0 = (long)xx[7] + xx11 - n;
+            long t1 = (long)xx[8] + xx12;
+            long t2 = (long)xx[9] + xx13;
 
             long cc = 0;
             cc += (long)xx[0] - t0;