summary refs log tree commit diff
path: root/crypto/src/math/raw/Nat224.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-08-02 16:52:44 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-08-02 16:52:44 +0700
commitb033b509c53b79d564ba17c4a69de78bd917ef80 (patch)
treebe14f91f7200da0b731f60fe0c53398efe83345b /crypto/src/math/raw/Nat224.cs
parentRefactor Equals/GetHashCode in X509 objects (diff)
downloadBouncyCastle.NET-ed25519-b033b509c53b79d564ba17c4a69de78bd917ef80.tar.xz
Updates to raw math classes from bc-java
Diffstat (limited to 'crypto/src/math/raw/Nat224.cs')
-rw-r--r--crypto/src/math/raw/Nat224.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/crypto/src/math/raw/Nat224.cs b/crypto/src/math/raw/Nat224.cs
index ff1eb6306..565abcb9c 100644
--- a/crypto/src/math/raw/Nat224.cs
+++ b/crypto/src/math/raw/Nat224.cs
@@ -509,9 +509,10 @@ namespace Org.BouncyCastle.Math.Raw
                 c += x_i * y_6 + zz[i + 6];
                 zz[i + 6] = (uint)c;
                 c >>= 32;
-                c += zc + zz[i + 7];
-                zz[i + 7] = (uint)c;
-                zc = c >> 32;
+
+                zc += c + zz[i + 7];
+                zz[i + 7] = (uint)zc;
+                zc >>= 32;
             }
             return (uint)zc;
         }
@@ -551,9 +552,10 @@ namespace Org.BouncyCastle.Math.Raw
                 c += x_i * y_6 + zz[zzOff + 6];
                 zz[zzOff + 6] = (uint)c;
                 c >>= 32;
-                c += zc + zz[zzOff + 7];
-                zz[zzOff + 7] = (uint)c;
-                zc = c >> 32;
+
+                zc += c + zz[zzOff + 7];
+                zz[zzOff + 7] = (uint)zc;
+                zc >>= 32;
                 ++zzOff;
             }
             return (uint)zc;