本文整理汇总了Java中org.bouncycastle.math.ec.ECCurve.createPoint方法的典型用法代码示例。如果您正苦于以下问题:Java ECCurve.createPoint方法的具体用法?Java ECCurve.createPoint怎么用?Java ECCurve.createPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.math.ec.ECCurve
的用法示例。
在下文中一共展示了ECCurve.createPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ECPointDeSerialization
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
private static ECPoint ECPointDeSerialization(byte[] serialized_point,
int offset, int pointLength, ECCurve curve) {
byte[] x_b = new byte[pointLength / 2];
byte[] y_b = new byte[pointLength / 2];
// System.out.println("Serialized Point: " + toHex(serialized_point));
// src -- This is the source array.
// srcPos -- This is the starting position in the source array.
// dest -- This is the destination array.
// destPos -- This is the starting position in the destination data.
// length -- This is the number of array elements to be copied.
System.arraycopy(serialized_point, offset + 1, x_b, 0, pointLength / 2);
BigInteger x = new BigInteger(bytesToHex(x_b), 16);
// System.out.println("X:" + toHex(x_b));
System.arraycopy(serialized_point, offset + (pointLength / 2 + 1), y_b, 0, pointLength / 2);
BigInteger y = new BigInteger(bytesToHex(y_b), 16);
// System.out.println("Y:" + toHex(y_b));
ECPoint point = curve.createPoint(x, y);
return point;
}
示例2: ECPointDeSerialization
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
public static ECPoint ECPointDeSerialization(ECCurve curve, byte[] serialized_point, int offset) {
byte[] x_b = new byte[256 / 8];
byte[] y_b = new byte[256 / 8];
// System.out.println("Serialized Point: " + toHex(serialized_point));
// src -- This is the source array.
// srcPos -- This is the starting position in the source array.
// dest -- This is the destination array.
// destPos -- This is the starting position in the destination data.
// length -- This is the number of array elements to be copied.
System.arraycopy(serialized_point, offset + 1, x_b, 0, Consts.SHARE_BASIC_SIZE);
BigInteger x = new BigInteger(bytesToHex(x_b), 16);
// System.out.println("X:" + toHex(x_b));
System.arraycopy(serialized_point, offset + (Consts.SHARE_BASIC_SIZE + 1), y_b, 0, Consts.SHARE_BASIC_SIZE);
BigInteger y = new BigInteger(bytesToHex(y_b), 16);
// System.out.println("Y:" + toHex(y_b));
ECPoint point = curve.createPoint(x, y);
return point;
}
示例3: convertPoint
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
private static org.bouncycastle.math.ec.ECPoint convertPoint(
ECCurve curve,
java.security.spec.ECPoint point,
boolean withCompression)
{
return curve.createPoint(point.getAffineX(), point.getAffineY(), withCompression);
}
示例4: convertPoint
import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
public static org.bouncycastle.math.ec.ECPoint convertPoint(
ECCurve curve,
ECPoint point,
boolean withCompression)
{
return curve.createPoint(point.getAffineX(), point.getAffineY(), withCompression);
}