Skip to content

Commit 61b5fb6

Browse files
committed
Refactor point validation
1 parent 3e761ae commit 61b5fb6

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

core/src/main/java/org/bouncycastle/crypto/agreement/ecjpake/ECJPAKECurve.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,8 @@ public ECJPAKECurve(BigInteger q, BigInteger a, BigInteger b, BigInteger n, BigI
9999
*/
100100
// BigInteger totalPoints = n.multiply(h);
101101

102-
ECCurve.Fp curve = new ECCurve.Fp(q, a, b, n, h);
103-
ECPoint g = curve.createPoint(g_x, g_y);
104-
105-
if (!g.isValid())
106-
{
107-
throw new IllegalArgumentException("The base point G does not lie on the curve.");
108-
}
109-
110-
this.curve = curve;
111-
this.g = g;
102+
this.curve = new ECCurve.Fp(q, a, b, n, h);
103+
this.g = curve.validatePoint(g_x, g_y);
112104
}
113105

114106
/**

0 commit comments

Comments
 (0)