本文整理汇总了Java中org.bouncycastle.math.ec.ECConstants类的典型用法代码示例。如果您正苦于以下问题:Java ECConstants类的具体用法?Java ECConstants怎么用?Java ECConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ECConstants类属于org.bouncycastle.math.ec包,在下文中一共展示了ECConstants类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParameters
import org.bouncycastle.math.ec.ECConstants; //导入依赖的package包/类
protected X9ECParameters createParameters()
{
// p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
BigInteger p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
BigInteger a = ECConstants.ZERO;
BigInteger b = BigInteger.valueOf(7);
byte[] S = null;
BigInteger n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
BigInteger h = BigInteger.valueOf(1);
ECCurve curve = new ECCurve.Fp(p, a, b);
// ECPoint G = curve.decodePoint(Hex.decode("02"
// + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"));
ECPoint G = curve.decodePoint(Hex.decode("04"
+ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"
+ "938CF935318FDCED6BC28286531733C3F03C4FEE"));
return new X9ECParameters(curve, G, n, h, S);
}
示例2: createParameters
import org.bouncycastle.math.ec.ECConstants; //导入依赖的package包/类
protected X9ECParameters createParameters()
{
int m = 233;
int k = 74;
BigInteger a = ECConstants.ZERO;
BigInteger b = BigInteger.valueOf(1);
byte[] S = null;
BigInteger n = fromHex("8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF");
BigInteger h = BigInteger.valueOf(4);
ECCurve curve = configureCurve(new ECCurve.F2m(m, k, a, b, n, h));
//ECPoint G = curve.decodePoint(Hex.decode("02"
//+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"));
X9ECPoint G = new X9ECPoint(curve, Hex.decode("04"
+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"
+ "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3"));
return new X9ECParameters(curve, G, n, h, S);
}
示例3: discoverEndomorphisms
import org.bouncycastle.math.ec.ECConstants; //导入依赖的package包/类
public static void discoverEndomorphisms(X9ECParameters x9)
{
if (x9 == null)
{
throw new NullPointerException("x9");
}
ECCurve c = x9.getCurve();
if (ECAlgorithms.isFpCurve(c))
{
BigInteger characteristic = c.getField().getCharacteristic();
if (c.getA().isZero() && characteristic.mod(ECConstants.THREE).equals(ECConstants.ONE))
{
System.out.println("Curve has a 'GLV Type B' endomorphism with these parameters:");
printGLVTypeBParameters(x9);
}
}
}
示例4: findBetaValues
import org.bouncycastle.math.ec.ECConstants; //导入依赖的package包/类
private static ECFieldElement[] findBetaValues(ECCurve c)
{
BigInteger q = c.getField().getCharacteristic();
BigInteger e = q.divide(ECConstants.THREE);
// Search for a random value that generates a non-trival cube root of 1
SecureRandom random = new SecureRandom();
BigInteger b;
do
{
BigInteger r = BigIntegers.createRandomInRange(ECConstants.TWO, q.subtract(ECConstants.TWO), random);
b = r.modPow(e, q);
}
while (b.equals(ECConstants.ONE));
ECFieldElement beta = c.fromBigInteger(b);
return new ECFieldElement[]{ beta, beta.square() };
}
示例5: discoverEndomorphism
import org.bouncycastle.math.ec.ECConstants; //导入依赖的package包/类
private static void discoverEndomorphism(String curveName)
{
X9ECParameters x9 = ECNamedCurveTable.getByName(curveName);
if (x9 == null)
{
System.err.println("Unknown curve: " + curveName);
return;
}
ECCurve c = x9.getCurve();
if (ECAlgorithms.isFpCurve(c))
{
BigInteger characteristic = c.getField().getCharacteristic();
if (c.getA().isZero() && characteristic.mod(ECConstants.THREE).equals(ECConstants.ONE))
{
System.out.println("Curve '" + curveName + "' has a 'GLV Type B' endomorphism with these parameters: ");
printGLVTypeBParameters(x9);
}
}
}
示例6: createParameters
import org.bouncycastle.math.ec.ECConstants; //导入依赖的package包/类
protected X9ECParameters createParameters()
{
int m = 233;
int k = 74;
BigInteger a = ECConstants.ZERO;
BigInteger b = BigInteger.valueOf(1);
byte[] S = null;
BigInteger n = fromHex("8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF");
BigInteger h = BigInteger.valueOf(4);
ECCurve curve = configureCurve(new ECCurve.F2m(m, k, a, b, n, h));
//ECPoint G = curve.decodePoint(Hex.decode("02"
//+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"));
ECPoint G = curve.decodePoint(Hex.decode("04"
+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"
+ "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3"));
return new X9ECParameters(curve, G, n, h, S);
}
示例7: createParameters
import org.bouncycastle.math.ec.ECConstants; //导入依赖的package包/类
protected X9ECParameters createParameters()
{
// p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
BigInteger p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
BigInteger a = ECConstants.ZERO;
BigInteger b = BigInteger.valueOf(7);
byte[] S = null;
BigInteger n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
BigInteger h = BigInteger.valueOf(1);
ECCurve curve = configureCurve(new ECCurve.Fp(p, a, b));
// ECPoint G = curve.decodePoint(Hex.decode("02"
// + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"));
ECPoint G = curve.decodePoint(Hex.decode("04"
+ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"
+ "938CF935318FDCED6BC28286531733C3F03C4FEE"));
return new X9ECParameters(curve, G, n, h, S);
}