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


Java ECCurve.Fp方法代码示例

本文整理汇总了Java中org.bouncycastle.math.ec.ECCurve.Fp方法的典型用法代码示例。如果您正苦于以下问题:Java ECCurve.Fp方法的具体用法?Java ECCurve.Fp怎么用?Java ECCurve.Fp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.math.ec.ECCurve的用法示例。


在下文中一共展示了ECCurve.Fp方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParams

import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
private ECParameterSpec getParams(ECDSAPublicKey key)
{
    if (!key.hasParameters())
    {
        throw new IllegalArgumentException("Public key does not contains EC Params");
    }

    BigInteger p = key.getPrimeModulusP();
    ECCurve.Fp curve = new ECCurve.Fp(p, key.getFirstCoefA(), key.getSecondCoefB());

    ECPoint G = curve.decodePoint(key.getBasePointG());

    BigInteger order = key.getOrderOfBasePointR();
    BigInteger coFactor = key.getCofactorF();
               // TODO: update to use JDK 1.5 EC API
    ECParameterSpec ecspec = new ECParameterSpec(curve, G, order, coFactor);

    return ecspec;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:JcaPublicKeyConverter.java

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

示例3: createParameters

import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
protected X9ECParameters createParameters()
{
    // p = (2^128 - 3) / 76439
    BigInteger p = fromHex("DB7C2ABF62E35E668076BEAD208B");
    BigInteger a = fromHex("DB7C2ABF62E35E668076BEAD2088");
    BigInteger b = fromHex("659EF8BA043916EEDE8911702B22");
    byte[] S = Hex.decode("00F50B028E4D696E676875615175290472783FB1");
    BigInteger n = fromHex("DB7C2ABF62E35E7628DFAC6561C5");
    BigInteger h = BigInteger.valueOf(1);

    ECCurve curve = new ECCurve.Fp(p, a, b);
    //ECPoint G = curve.decodePoint(Hex.decode("02"
    //+ "09487239995A5EE76B55F9C2F098"));
    ECPoint G = curve.decodePoint(Hex.decode("04"
        + "09487239995A5EE76B55F9C2F098"
        + "A89CE5AF8724C0A23E0E0FF77500"));

    return new X9ECParameters(curve, G, n, h, S);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:SECNamedCurves.java

示例4: createParameters

import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
protected X9ECParameters createParameters()
{
    ECCurve curve = new ECCurve.Fp(
        //new BigInteger("2DF271E14427A346910CF7A2E6CFA7B3F484E5C2CCE1C8B730E28B3F") //Z
        new BigInteger("D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF", 16), // q
        new BigInteger("D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FC", 16), // a'
        new BigInteger("4B337D934104CD7BEF271BF60CED1ED20DA14C08B3BB64F18A60888D", 16)); // b'

    return new X9ECParameters(
        curve,
        curve.decodePoint(Hex.decode("046AB1E344CE25FF3896424E7FFE14762ECB49F8928AC0C76029B4D5800374E9F5143E568CD23F3F4D7C0D4B1E41C8CC0D1C6ABD5F1A46DB4C")), // G'
        new BigInteger("D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F", 16), //n
        new BigInteger("01", 16)); // h
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:TeleTrusTNamedCurves.java

示例5: createParameters

import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
protected X9ECParameters createParameters()
{
    ECCurve cFp239v2 = new ECCurve.Fp(
        new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
        new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16),
        new BigInteger("617fab6832576cbbfed50d99f0249c3fee58b94ba0038c7ae84c8c832f2c", 16));

    return new X9ECParameters(
        cFp239v2,
        cFp239v2.decodePoint(
            Hex.decode("0238af09d98727705120c921bb5e9e26296a3cdcf2f35757a0eafd87b830e7")),
        new BigInteger("7fffffffffffffffffffffff800000cfa7e8594377d414c03821bc582063", 16),
        BigInteger.valueOf(1),
        Hex.decode("e8b4011604095303ca3b8099982be09fcb9ae616"));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:16,代码来源:X962NamedCurves.java

示例6: setFieldIdentifier

import org.bouncycastle.math.ec.ECCurve; //导入方法依赖的package包/类
private void setFieldIdentifier()
{
    if (curve instanceof ECCurve.Fp)
    {
        fieldIdentifier = prime_field;
    }
    else if (curve instanceof ECCurve.F2m)
    {
        fieldIdentifier = characteristic_two_field;
    }
    else
    {
        throw new IllegalArgumentException("This type of ECCurve is not implemented");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:16,代码来源:X9Curve.java


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