use of org.spongycastle.math.ec.ECFieldElement in project jmulticard by ctt-gob-es.
the class JseCryptoHelper method computeAffineY.
private static BigInteger computeAffineY(final BigInteger affineX, final ECParameterSpec params) {
final ECCurve bcCurve = toSpongyCastleECCurve(params);
final ECFieldElement a = bcCurve.getA();
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();
}
Aggregations