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:
Diffstat (limited to 'core/src/main/java/org/bouncycastle/math/ec/ECCurve.java')
-rw-r--r--core/src/main/java/org/bouncycastle/math/ec/ECCurve.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java b/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
index cd0593c9..4c658f20 100644
--- a/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
+++ b/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
@@ -353,6 +353,11 @@ public abstract class ECCurve
BigInteger X = BigIntegers.fromUnsignedByteArray(encoded, 1, expectedLength);
p = decompressPoint(yTilde, X);
+ if (!p.satisfiesCofactor())
+ {
+ throw new IllegalArgumentException("Invalid point");
+ }
+
break;
}
case 0x04: // uncompressed
@@ -472,12 +477,7 @@ public abstract class ECCurve
y = y.negate();
}
- ECPoint p = this.createRawPoint(x, y, true);
- if (!p.satisfiesCofactor())
- {
- throw new IllegalArgumentException("Invalid point");
- }
- return p;
+ return this.createRawPoint(x, y, true);
}
}
@@ -1017,13 +1017,7 @@ public abstract class ECCurve
throw new IllegalArgumentException("Invalid point compression");
}
- ECPoint p = this.createRawPoint(x, y, true);
- if (!p.satisfiesCofactor())
- {
- throw new IllegalArgumentException("Invalid point");
- }
-
- return p;
+ return this.createRawPoint(x, y, true);
}
/**