final ECFieldElement b = bcCurve.getB();
final ECFieldElement x = bcCurve.fromBigInteger(affineX);
final ECFieldElement y = x.multiply(x).add(a).multiply(x).add(b).sqrt();
return y.toBigInteger();
}
<BUG>private static ECCurve toBouncyCastleECCurve(final ECParameterSpec params) {
</BUG>
final EllipticCurve curve = params.getCurve();
final ECField field = curve.getField();
if (!(field instanceof ECFieldFp)) {

final ECFieldElement b = bcCurve.getB();
final ECFieldElement x = bcCurve.fromBigInteger(affineX);
final ECFieldElement y = x.multiply(x).add(a).multiply(x).add(b).sqrt();
return y.toBigInteger();
}
private static ECCurve toSpongyCastleECCurve(final ECParameterSpec params) {
final EllipticCurve curve = params.getCurve();
final ECField field = curve.getField();
if (!(field instanceof ECFieldFp)) {
