{
BigInteger prime_p = readECParameter(input);
BigInteger a = readECFieldElement(prime_p.bitLength(), input);
BigInteger b = readECFieldElement(prime_p.bitLength(), input);
ECCurve curve = new ECCurve.Fp(prime_p, a, b);
ECPoint base = deserializeECPoint(ecPointFormats, curve, TlsUtils.readOpaque8(input));
BigInteger order = readECParameter(input);
BigInteger cofactor = readECParameter(input);
return new ECDomainParameters(curve, base, order, cofactor);
}
case ECCurveType.explicit_char2:
{
int m = TlsUtils.readUint16(input);
short basis = TlsUtils.readUint8(input);
ECCurve curve;
switch (basis)
{
case ECBasisType.ec_basis_trinomial:
{
int k = readECExponent(m, input);
BigInteger a = readECFieldElement(m, input);
BigInteger b = readECFieldElement(m, input);
curve = new ECCurve.F2m(m, k, a, b);
break;
}
case ECBasisType.ec_basis_pentanomial:
{
int k1 = readECExponent(m, input);
int k2 = readECExponent(m, input);
int k3 = readECExponent(m, input);
BigInteger a = readECFieldElement(m, input);
BigInteger b = readECFieldElement(m, input);
curve = new ECCurve.F2m(m, k1, k2, k3, a, b);
break;
}
default:
throw new TlsFatalAlert(AlertDescription.illegal_parameter);
}
ECPoint base = deserializeECPoint(ecPointFormats, curve, TlsUtils.readOpaque8(input));
BigInteger order = readECParameter(input);
BigInteger cofactor = readECParameter(input);
return new ECDomainParameters(curve, base, order, cofactor);
}
case ECCurveType.named_curve: