public static BigInteger getY(BigInteger x, boolean lsb, EllipticCurve curve)
      throws GeneralSecurityException {
    BigInteger p = getModulus(curve);
    BigInteger a = curve.getA();
    BigInteger b = curve.getB();
    BigInteger rhs = x.multiply(x).add(a).multiply(x).add(b).mod(p);
    BigInteger y = modSqrt(rhs, p);
    if (lsb != y.testBit(0)) {
      y = p.subtract(y).mod(p);
    }
    return y;
  }
Computes the y coordinate of a point on an elliptic curve. This method can be used to
decompress elliptic curve points.

@param x the x-coordinate of the point
@param lsb the least significant bit of the y-coordinate of the point.
@param curve this must be an elliptic curve over a prime field using Weierstrass
    representation.
@return the y coordinate.
@throws GeneralSecurityException if there is no point with coordinate x on the curve, or if
    curve is not supported.
java_src/src/main/java/com/google/crypto/tink/subtle/EllipticCurves.java