diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-02 16:52:44 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-02 16:52:44 +0700 |
commit | b033b509c53b79d564ba17c4a69de78bd917ef80 (patch) | |
tree | be14f91f7200da0b731f60fe0c53398efe83345b /crypto/src/math/raw/Nat256.cs | |
parent | Refactor Equals/GetHashCode in X509 objects (diff) | |
download | BouncyCastle.NET-ed25519-b033b509c53b79d564ba17c4a69de78bd917ef80.tar.xz |
Updates to raw math classes from bc-java
Diffstat (limited to 'crypto/src/math/raw/Nat256.cs')
-rw-r--r-- | crypto/src/math/raw/Nat256.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crypto/src/math/raw/Nat256.cs b/crypto/src/math/raw/Nat256.cs index 2be03d642..5c473c405 100644 --- a/crypto/src/math/raw/Nat256.cs +++ b/crypto/src/math/raw/Nat256.cs @@ -632,9 +632,10 @@ namespace Org.BouncyCastle.Math.Raw c += x_i * y_7 + zz[i + 7]; zz[i + 7] = (uint)c; c >>= 32; - c += zc + zz[i + 8]; - zz[i + 8] = (uint)c; - zc = c >> 32; + + zc += c + zz[i + 8]; + zz[i + 8] = (uint)zc; + zc >>= 32; } return (uint)zc; } @@ -678,9 +679,10 @@ namespace Org.BouncyCastle.Math.Raw c += x_i * y_7 + zz[zzOff + 7]; zz[zzOff + 7] = (uint)c; c >>= 32; - c += zc + zz[zzOff + 8]; - zz[zzOff + 8] = (uint)c; - zc = c >> 32; + + zc += c + zz[zzOff + 8]; + zz[zzOff + 8] = (uint)zc; + zc >>= 32; ++zzOff; } return (uint)zc; |