当前位置: 首页>>代码示例>>Java>>正文


Java ECCurve.createPoint方法代码示例

本文整理汇总了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;
}
 
开发者ID:OpenCryptoProject,项目名称:JCMathLib,代码行数:24,代码来源:Util.java

示例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;
    }
 
开发者ID:OpenCryptoProject,项目名称:Myst,代码行数:23,代码来源:Util.java

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:8,代码来源:JcaPublicKeyConverter.java

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:8,代码来源:EC5Util.java


注:本文中的org.bouncycastle.math.ec.ECCurve.createPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。