summary refs log tree commit diff
path: root/crypto/src/math/BigInteger.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-12-03 10:20:23 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-12-03 10:20:23 +0700
commit9f1d8353ae8d4a989b109a091e31a067d5a9c204 (patch)
tree123e4d4f77262fb252263db6a5b976490b20f77e /crypto/src/math/BigInteger.cs
parentUse 1/n-1 record splitting instead of 0/n (diff)
downloadBouncyCastle.NET-ed25519-9f1d8353ae8d4a989b109a091e31a067d5a9c204.tar.xz
Always apply sign guard
Diffstat (limited to '')
-rw-r--r--crypto/src/math/BigInteger.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/math/BigInteger.cs b/crypto/src/math/BigInteger.cs
index 00f8f399d..3b8a820d7 100644
--- a/crypto/src/math/BigInteger.cs
+++ b/crypto/src/math/BigInteger.cs
@@ -1678,11 +1678,11 @@ namespace Org.BouncyCastle.Math
                     bitsCorrect <<= 1;
                 }
                 while (bitsCorrect < pow);
+            }
 
-                if (x.sign < 0)
-                {
-                    x = x.Add(m);
-                }
+            if (x.sign < 0)
+            {
+                x = x.Add(m);
             }
 
             return x;