本文整理汇总了Java中org.bouncycastle.math.ec.ECCurve.F2m方法的典型用法代码示例。如果您正苦于以下问题:Java ECCurve.F2m方法的具体用法?Java ECCurve.F2m怎么用?Java ECCurve.F2m使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.math.ec.ECCurve
的用法示例。
在下文中一共展示了ECCurve.F2m方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParameters
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
protected X9ECParameters createParameters()
{
BigInteger c2m163v3n = new BigInteger("03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309", 16);
BigInteger c2m163v3h = BigInteger.valueOf(2);
ECCurve c2m163v3 = new ECCurve.F2m(
163,
1, 2, 8,
new BigInteger("07A526C63D3E25A256A007699F5447E32AE456B50E", 16),
new BigInteger("03F7061798EB99E238FD6F1BF95B48FEEB4854252B", 16),
c2m163v3n, c2m163v3h);
return new X9ECParameters(
c2m163v3,
c2m163v3.decodePoint(
Hex.decode("0202F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB")),
c2m163v3n, c2m163v3h,
null);
}
示例2: serializeECPoint
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
public static byte[] serializeECPoint(short[] ecPointFormats, ECPoint point)
throws IOException
{
ECCurve curve = point.getCurve();
/*
* RFC 4492 5.7. ...an elliptic curve point in uncompressed or compressed format. Here, the
* format MUST conform to what the server has requested through a Supported Point Formats
* Extension if this extension was used, and MUST be uncompressed if this extension was not
* used.
*/
boolean compressed = false;
if (curve instanceof ECCurve.F2m)
{
compressed = isCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_char2);
}
else if (curve instanceof ECCurve.Fp)
{
compressed = isCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_prime);
}
return point.getEncoded(compressed);
}
示例3: createParameters
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
protected X9ECParameters createParameters()
{
int m = 113;
int k = 9;
BigInteger a = fromHex("003088250CA6E7C7FE649CE85820F7");
BigInteger b = fromHex("00E8BEE4D3E2260744188BE0E9C723");
byte[] S = Hex.decode("10E723AB14D696E6768756151756FEBF8FCB49A9");
BigInteger n = fromHex("0100000000000000D9CCEC8A39E56F");
BigInteger h = BigInteger.valueOf(2);
ECCurve curve = new ECCurve.F2m(m, k, a, b, n, h);
//ECPoint G = curve.decodePoint(Hex.decode("03"
//+ "009D73616F35F4AB1407D73562C10F"));
ECPoint G = curve.decodePoint(Hex.decode("04"
+ "009D73616F35F4AB1407D73562C10F"
+ "00A52830277958EE84D1315ED31886"));
return new X9ECParameters(curve, G, n, h, S);
}
示例4: DSTU4145ECBinary
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
public DSTU4145ECBinary(ECDomainParameters params)
{
if (!(params.getCurve() instanceof ECCurve.F2m))
{
throw new IllegalArgumentException("only binary domain is possible");
}
// We always use big-endian in parameter encoding
ECCurve.F2m curve = (ECCurve.F2m)params.getCurve();
f = new DSTU4145BinaryField(curve.getM(), curve.getK1(), curve.getK2(), curve.getK3());
a = new ASN1Integer(curve.getA().toBigInteger());
X9IntegerConverter converter = new X9IntegerConverter();
b = new DEROctetString(converter.integerToBytes(curve.getB().toBigInteger(), converter.getByteLength(curve)));
n = new ASN1Integer(params.getN());
bp = new DEROctetString(DSTU4145PointEncoder.encodePoint(params.getG()));
}
示例5: convertCurve
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
public static ECCurve convertCurve(
EllipticCurve ec)
{
ECField field = ec.getField();
BigInteger a = ec.getA();
BigInteger b = ec.getB();
if (field instanceof ECFieldFp)
{
return new ECCurve.Fp(((ECFieldFp)field).getP(), a, b);
}
else
{
ECFieldF2m fieldF2m = (ECFieldF2m)field;
int m = fieldF2m.getM();
int ks[] = ECUtil.convertMidTerms(fieldF2m.getMidTermsOfReductionPolynomial());
return new ECCurve.F2m(m, ks[0], ks[1], ks[2], a, b);
}
}
示例6: X9ECParameters
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
public X9ECParameters(
ECCurve curve,
ECPoint g,
BigInteger n,
BigInteger h,
byte[] seed)
{
this.curve = curve;
this.g = g;
this.n = n;
this.h = h;
this.seed = seed;
if (curve instanceof ECCurve.Fp)
{
this.fieldID = new X9FieldID(((ECCurve.Fp)curve).getQ());
}
else
{
if (curve instanceof ECCurve.F2m)
{
ECCurve.F2m curveF2m = (ECCurve.F2m)curve;
this.fieldID = new X9FieldID(curveF2m.getM(), curveF2m.getK1(),
curveF2m.getK2(), curveF2m.getK3());
}
}
}