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


Java GoppaCode.createCanonicalCheckMatrix方法代码示例

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


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

示例1: generateKeyPair

import org.bouncycastle.pqc.math.linearalgebra.GoppaCode; //导入方法依赖的package包/类
public AsymmetricCipherKeyPair generateKeyPair()
{

    if (!initialized)
    {
        initializeDefault();
    }

    // finite field GF(2^m)
    GF2mField field = new GF2mField(m, fieldPoly);

    // irreducible Goppa polynomial
    PolynomialGF2mSmallM gp = new PolynomialGF2mSmallM(field, t,
        PolynomialGF2mSmallM.RANDOM_IRREDUCIBLE_POLYNOMIAL, random);
    PolynomialRingGF2m ring = new PolynomialRingGF2m(field, gp);

    // matrix for computing square roots in (GF(2^m))^t
    PolynomialGF2mSmallM[] qInv = ring.getSquareRootMatrix();

    // generate canonical check matrix
    GF2Matrix h = GoppaCode.createCanonicalCheckMatrix(field, gp);

    // compute short systematic form of check matrix
    MaMaPe mmp = GoppaCode.computeSystematicForm(h, random);
    GF2Matrix shortH = mmp.getSecondMatrix();
    Permutation p = mmp.getPermutation();

    // compute short systematic form of generator matrix
    GF2Matrix shortG = (GF2Matrix)shortH.computeTranspose();

    // obtain number of rows of G (= dimension of the code)
    int k = shortG.getNumRows();

    // generate keys
    McElieceCCA2PublicKeyParameters pubKey = new McElieceCCA2PublicKeyParameters(OID, n, t, shortG, mcElieceCCA2Params.getParameters());
    McElieceCCA2PrivateKeyParameters privKey = new McElieceCCA2PrivateKeyParameters(OID, n, k,
        field, gp, p, h, qInv, mcElieceCCA2Params.getParameters());

    // return key pair
    return new AsymmetricCipherKeyPair(pubKey, privKey);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:42,代码来源:McElieceCCA2KeyPairGenerator.java


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