public McEliecePublicKey(ASN1ObjectIdentifier oid, int n, int t, GF2Matrix g) { this.oid = oid; this.n = n; this.t = t; this.matrixG = g.getEncoded(); }
public McElieceCCA2PublicKey(ASN1ObjectIdentifier oid, int n, int t, GF2Matrix g) { this.oid = oid; this.n = n; this.t = t; this.matrixG = g.getEncoded(); }
public McElieceCCA2PublicKey(int n, int t, GF2Matrix g, AlgorithmIdentifier digest) { this.n = n; this.t = t; this.g = new GF2Matrix(g.getEncoded()); this.digest = digest; }
public static void main( String[] args ) { System.out.println("ceil: [" + (15 >>> 5) + "]"); System.out.println("ceil: [" + (31 >>> 5) + "]"); System.out.println("ceil: [" + (32 >>> 5) + "]"); System.out.println("ceil: [" + (36 >>> 5) + "]"); System.out.println("ceil: [" + (63 >>> 5) + "]"); System.out.println("ceil: [" + (64 >>> 5) + "]"); System.out.println("ceil: [" + (66 >>> 5) + "]"); GF2Matrix m = new GF2Matrix(33, GF2Matrix.MATRIX_TYPE_RANDOM_REGULAR); System.out.println("Matrix: " + m.toString()); final int[][] a = m.getIntArray(); for(int i=0; i<m.getNumRows(); i++){ System.out.println("MatrixEnc["+i+"]: [" + Utils.toBinaryString(a[i])+ "]"); } System.out.println("MatrixEncLen: [" + m.getEncoded().length + "]"); System.out.println("MatrixEncHex: [" + IntUtils.toHexString(m.getRow(0)) + "]"); } }
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(); } }
public McEliecePrivateKey(int n, int k, GF2mField field, PolynomialGF2mSmallM goppaPoly, Permutation p1, Permutation p2, GF2Matrix sInv) { 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(); }
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(); } }
public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); // encode <n> v.add(new ASN1Integer(n)); // encode <t> v.add(new ASN1Integer(t)); // encode <matrixG> v.add(new DEROctetString(g.getEncoded())); return new DERSequence(v); }
public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); // encode <n> v.add(new ASN1Integer(n)); // encode <t> v.add(new ASN1Integer(t)); // encode <matrixG> v.add(new DEROctetString(g.getEncoded())); v.add(digest); return new DERSequence(v); }