diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-25 20:44:18 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-25 20:44:18 +0700 |
commit | fcbb6956ca47b38549143f289d017485217c7a36 (patch) | |
tree | abddd70f8a93540cea79b892f3fb2e177ca5a86c | |
parent | Implement homogeneous and lambda-projective coordinate systems in F2m curves (diff) | |
download | BouncyCastle.NET-ed25519-fcbb6956ca47b38549143f289d017485217c7a36.tar.xz |
Add 0 guard in ModInverse
-rw-r--r-- | crypto/src/math/ec/LongArray.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/src/math/ec/LongArray.cs b/crypto/src/math/ec/LongArray.cs index d694f0cf0..a863c0a61 100644 --- a/crypto/src/math/ec/LongArray.cs +++ b/crypto/src/math/ec/LongArray.cs @@ -1879,6 +1879,10 @@ namespace Org.BouncyCastle.Math.EC * Output: a(z)^(-1) mod f(z) */ int uzDegree = Degree(); + if (uzDegree == 0) + { + throw new InvalidOperationException(); + } if (uzDegree == 1) { return this; |