Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-07-23 08:53:10 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-07-23 08:53:10 +0400
commit90ece8c1134d8e0119e88d5bc0baec8a82d30a1d (patch)
tree7d10e9a632466f11024ddb321e8861eb44958630
parent6008b9c96a09f4d570a5f1ec8dd4f05331694007 (diff)
Minor optimization for common case of cofactor==1
-rw-r--r--core/src/main/java/org/bouncycastle/math/ec/ECPoint.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java b/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java
index 53260179..1ecbcb30 100644
--- a/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java
+++ b/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java
@@ -304,7 +304,8 @@ public abstract class ECPoint
}
BigInteger h = curve.getCofactor();
- if (h != null && ECAlgorithms.referenceMultiply(this, h).isInfinity())
+ if (h != null && !h.equals(ECConstants.ONE)
+ && ECAlgorithms.referenceMultiply(this, h).isInfinity())
{
return false;
}