• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Permutation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Permutation类属于org.bouncycastle.pqc.math.linearalgebra包,在下文中一共展示了Permutation类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: McEliecePrivateKeyParameters

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor (used by the {@link McElieceKeyFactory}).
 *
 * @param oid
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encField     the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encSInv      the encoded matrix <tt>S<sup>-1</sup></tt>
 * @param encP1        the encoded permutation used to generate the systematic
 *                     check matrix
 * @param encP2        the encoded permutation used to compute the public
 *                     generator matrix
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2<sup>m</sup>))<sup>t</sup></tt>
 * @param params       McElieceParameters
 */
public McEliecePrivateKeyParameters(String oid, int n, int k, byte[] encField,
                                    byte[] encGoppaPoly, byte[] encSInv, byte[] encP1, byte[] encP2,
                                    byte[] encH, byte[][] encQInv, McElieceParameters params)
{
    super(true, params);
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encField);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    sInv = new GF2Matrix(encSInv);
    p1 = new Permutation(encP1);
    p2 = new Permutation(encP2);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:40,代码来源:McEliecePrivateKeyParameters.java


示例2: McElieceCCA2PrivateKeyParameters

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor used by the {@link McElieceKeyFactory}.
 *
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encFieldPoly the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encP         the encoded permutation
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2^m))^t</tt>
 * @param params       McElieceCCA2Parameters
 */
public McElieceCCA2PrivateKeyParameters(String oid, int n, int k, byte[] encFieldPoly,
                                        byte[] encGoppaPoly, byte[] encP, byte[] encH, byte[][] encQInv, McElieceCCA2Parameters params)
{
    super(true, params);
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encFieldPoly);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    p = new Permutation(encP);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:32,代码来源:McElieceCCA2PrivateKeyParameters.java


示例3: McElieceCCA2PrivateKey

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
public McElieceCCA2PrivateKey(ASN1ObjectIdentifier oid, int n, int k, GF2mField field, PolynomialGF2mSmallM goppaPoly, Permutation p, GF2Matrix h, PolynomialGF2mSmallM[] qInv)
{
    this.oid = oid;
    this.n = n;
    this.k = k;
    this.encField = field.getEncoded();
    this.encGp = goppaPoly.getEncoded();
    this.encP = p.getEncoded();
    this.encH = h.getEncoded();
    this.encqInv = new byte[qInv.length][];

    for (int i = 0; i != qInv.length; i++)
    {
        encqInv[i] = qInv[i].getEncoded();
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:17,代码来源:McElieceCCA2PrivateKey.java


示例4: McEliecePrivateKey

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
public McEliecePrivateKey(ASN1ObjectIdentifier oid, int n, int k, GF2mField field, PolynomialGF2mSmallM goppaPoly, GF2Matrix sInv, Permutation p1, Permutation p2, GF2Matrix h, PolynomialGF2mSmallM[] qInv)
{
    this.oid = oid;
    this.n = n;
    this.k = k;
    this.encField = field.getEncoded();
    this.encGp = goppaPoly.getEncoded();
    this.encSInv = sInv.getEncoded();
    this.encP1 = p1.getEncoded();
    this.encP2 = p2.getEncoded();
    this.encH = h.getEncoded();
    this.encqInv = new byte[qInv.length][];

    for (int i = 0; i != qInv.length; i++)
    {
        encqInv[i] = qInv[i].getEncoded();
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:McEliecePrivateKey.java


示例5: McElieceCCA2PrivateKeySpec

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor used by the {@link McElieceKeyFactory}.
 *
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encFieldPoly the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encP         the encoded permutation
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2^m))^t</tt>
 */
public McElieceCCA2PrivateKeySpec(String oid, int n, int k, byte[] encFieldPoly,
                                  byte[] encGoppaPoly, byte[] encP, byte[] encH, byte[][] encQInv)
{
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encFieldPoly);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    p = new Permutation(encP);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:30,代码来源:McElieceCCA2PrivateKeySpec.java


示例6: McEliecePrivateKeySpec

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor (used by the {@link McElieceKeyFactory}).
 *
 * @param oid
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encField     the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encSInv      the encoded matrix <tt>S<sup>-1</sup></tt>
 * @param encP1        the encoded permutation used to generate the systematic
 *                     check matrix
 * @param encP2        the encoded permutation used to compute the public
 *                     generator matrix
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2<sup>m</sup>))<sup>t</sup></tt>
 */
public McEliecePrivateKeySpec(String oid, int n, int k, byte[] encField,
                              byte[] encGoppaPoly, byte[] encSInv, byte[] encP1, byte[] encP2,
                              byte[] encH, byte[][] encQInv)
{
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encField);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    sInv = new GF2Matrix(encSInv);
    p1 = new Permutation(encP1);
    p2 = new Permutation(encP2);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:McEliecePrivateKeySpec.java


示例7: McEliecePrivateKeyParameters

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param oid
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encField     the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encSInv      the encoded matrix <tt>S<sup>-1</sup></tt>
 * @param encP1        the encoded permutation used to generate the systematic
 *                     check matrix
 * @param encP2        the encoded permutation used to compute the public
 *                     generator matrix
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2<sup>m</sup>))<sup>t</sup></tt>
 * @param params       McElieceParameters
 */
public McEliecePrivateKeyParameters(String oid, int n, int k, byte[] encField,
                                    byte[] encGoppaPoly, byte[] encSInv, byte[] encP1, byte[] encP2,
                                    byte[] encH, byte[][] encQInv, McElieceParameters params)
{
    super(true, params);
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encField);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    sInv = new GF2Matrix(encSInv);
    p1 = new Permutation(encP1);
    p2 = new Permutation(encP2);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:40,代码来源:McEliecePrivateKeyParameters.java


示例8: McElieceCCA2PrivateKeyParameters

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encFieldPoly the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encP         the encoded permutation
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2^m))^t</tt>
 * @param params       McElieceCCA2Parameters
 */
public McElieceCCA2PrivateKeyParameters(String oid, int n, int k, byte[] encFieldPoly,
                                        byte[] encGoppaPoly, byte[] encP, byte[] encH, byte[][] encQInv, McElieceCCA2Parameters params)
{
    super(true, params);
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encFieldPoly);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    p = new Permutation(encP);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:32,代码来源:McElieceCCA2PrivateKeyParameters.java


示例9: McElieceCCA2PrivateKeySpec

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encFieldPoly the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encP         the encoded permutation
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2^m))^t</tt>
 */
public McElieceCCA2PrivateKeySpec(String oid, int n, int k, byte[] encFieldPoly,
                                  byte[] encGoppaPoly, byte[] encP, byte[] encH, byte[][] encQInv)
{
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encFieldPoly);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    p = new Permutation(encP);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:30,代码来源:McElieceCCA2PrivateKeySpec.java


示例10: McEliecePrivateKeySpec

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param oid          string representation of the object identifier the algorithm for this key.
 * @param n            the length of the code
 * @param k            the dimension of the code
 * @param encField     the encoded field polynomial defining the finite field
 *                     <tt>GF(2<sup>m</sup>)</tt>
 * @param encGoppaPoly the encoded irreducible Goppa polynomial
 * @param encSInv      the encoded matrix <tt>S<sup>-1</sup></tt>
 * @param encP1        the encoded permutation used to generate the systematic
 *                     check matrix
 * @param encP2        the encoded permutation used to compute the public
 *                     generator matrix
 * @param encH         the encoded canonical check matrix
 * @param encQInv      the encoded matrix used to compute square roots in
 *                     <tt>(GF(2<sup>m</sup>))<sup>t</sup></tt>
 */
public McEliecePrivateKeySpec(String oid, int n, int k, byte[] encField,
                              byte[] encGoppaPoly, byte[] encSInv, byte[] encP1, byte[] encP2,
                              byte[] encH, byte[][] encQInv)
{
    this.oid = oid;
    this.n = n;
    this.k = k;
    field = new GF2mField(encField);
    goppaPoly = new PolynomialGF2mSmallM(field, encGoppaPoly);
    sInv = new GF2Matrix(encSInv);
    p1 = new Permutation(encP1);
    p2 = new Permutation(encP2);
    h = new GF2Matrix(encH);
    qInv = new PolynomialGF2mSmallM[encQInv.length];
    for (int i = 0; i < encQInv.length; i++)
    {
        qInv[i] = new PolynomialGF2mSmallM(field, encQInv[i]);
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:38,代码来源:McEliecePrivateKeySpec.java


示例11: assignRandomRegularMatrix

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Create an nxn random regular matrix.
 *
 * @param n  number of rows (and columns)
 * @param sr source of randomness
 */
public void assignRandomRegularMatrix(int n, SecureRandom sr)
{
    numRows = n;
    numColumns = n;
    length = (n + (INTSIZE-1)) >>> BLOCKEXP;
    matrix = new int[numRows][length];
    GF2MatrixEx lm = new GF2MatrixEx(n, Matrix.MATRIX_TYPE_RANDOM_LT, sr);
    GF2MatrixEx um = new GF2MatrixEx(n, Matrix.MATRIX_TYPE_RANDOM_UT, sr);
    GF2MatrixEx rm = (GF2MatrixEx)lm.rightMultiply(um);
    Permutation perm = new Permutation(n, sr);
    int[] p = perm.getVector();
    for (int i = 0; i < n; i++)
    {
        System.arraycopy(rm.getIntArray()[i], 0, matrix[p[i]], 0, length);
    }
}
 
开发者ID:xbacinsk,项目名称:White-box_cipher_java,代码行数:23,代码来源:GF2MatrixEx.java


示例12: leftMultiply

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Compute the product of a permutation matrix (which is generated from an
 * n-permutation) and this matrix.
 *
 * @param p the permutation
 * @return {@link GF2MatrixEx} <tt>P*this</tt>
 */
public Matrix leftMultiply(Permutation p)
{
    int[] pVec = p.getVector();
    if (pVec.length != numRows)
    {
        throw new ArithmeticException("length mismatch");
    }

    int[][] result = new int[numRows][];

    for (int i = numRows - 1; i >= 0; i--)
    {
        result[i] = IntUtils.clone(matrix[pVec[i]]);
    }

    return new GF2MatrixEx(numRows, result);
}
 
开发者ID:xbacinsk,项目名称:White-box_cipher_java,代码行数:25,代码来源:GF2MatrixEx.java


示例13: rightMultiply

import org.bouncycastle.pqc.math.linearalgebra.Permutation; //导入依赖的package包/类
/**
 * Compute the product of this matrix and a permutation matrix which is
 * generated from an n-permutation.
 *
 * @param p the permutation
 * @return {@link GF2MatrixEx} <tt>this*P</tt>
 */
public Matrix rightMultiply(Permutation p)
{

    int[] pVec = p.getVector();
    if (pVec.length != numColumns)
    {
        throw new ArithmeticException("length mismatch");
    }

    GF2MatrixEx result = new GF2MatrixEx(numRows, numColumns);

    for (int i = numColumns - 1; i >= 0; i--)
    {
        int q = i >>> BLOCKEXP;
        int r = i & 0x1f;
        int pq = pVec[i] >>> BLOCKEXP;
        int pr = pVec[i] & 0x1f;
        for (int j = numRows - 1; j >= 0; j--)
        {
            result.matrix[j][q] |= ((matrix[j][pq] >>> pr) & 1) << r;
        }
    }

    return result;
}
 
开发者ID:xbacinsk,项目名称:White-box_cipher_java,代码行数:33,代码来源:GF2MatrixEx.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NonExistingResource类代码示例发布时间:2022-05-22
下一篇:
Java SlackMessagePostedListener类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap