summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2016-11-10 14:42:27 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2016-11-10 14:42:27 +0700
commit5f3830451fa08884b751b8de4f2ee8109ac3527f (patch)
treec6c63f1b2cdd8c7e1f2b16f015c7151ad0ee1d21
parentThrow excepton on unknown tag (diff)
downloadBouncyCastle.NET-ed25519-5f3830451fa08884b751b8de4f2ee8109ac3527f.tar.xz
Fix possible NPE when cofactor != 1 (from bc-java)
-rw-r--r--crypto/src/math/ec/multiplier/WNafUtilities.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/src/math/ec/multiplier/WNafUtilities.cs b/crypto/src/math/ec/multiplier/WNafUtilities.cs
index 5491297d7..7d565dfbd 100644
--- a/crypto/src/math/ec/multiplier/WNafUtilities.cs
+++ b/crypto/src/math/ec/multiplier/WNafUtilities.cs
@@ -423,7 +423,7 @@ namespace Org.BouncyCastle.Math.EC.Multiplier
                              *      1) additions do not use the curve's A, B coefficients.
                              *      2) no special cases (i.e. Q +/- Q) when calculating 1P, 3P, 5P, ...
                              */
-                            if (ECAlgorithms.IsFpCurve(c) && c.FieldSize >= 64)
+                            if (!twiceP.IsInfinity && ECAlgorithms.IsFpCurve(c) && c.FieldSize >= 64)
                             {
                                 switch (c.CoordinateSystem)
                                 {