Search in sources :

Example 1 with ECCurve

use of org.spongycastle.math.ec.ECCurve 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();
}
Also used : ECCurve(org.spongycastle.math.ec.ECCurve) ECFieldElement(org.spongycastle.math.ec.ECFieldElement)

Aggregations

ECCurve (org.spongycastle.math.ec.ECCurve)1 ECFieldElement (org.spongycastle.math.ec.ECFieldElement)1