public McEliecePublicKey(int n, int t, GF2Matrix g) { this.n = n; this.t = t; this.g = new GF2Matrix(g); }
public GF2Matrix getH() { return new GF2Matrix(encH); }
public GF2Matrix getG() { return new GF2Matrix(matrixG); }
public GF2Matrix getG() { return new GF2Matrix(g); }
public GF2Matrix getH() { return new GF2Matrix(encH); }
public GF2Matrix getG() { return new GF2Matrix(matrixG); }
public GF2Matrix getSInv() { return new GF2Matrix(encSInv); }
/** * Constructor. * * @param n the length of the code * @param t the error correction capability of the code * @param g the generator matrix */ public McEliecePublicKeyParameters(int n, int t, GF2Matrix g) { super(false, null); this.n = n; this.t = t; this.g = new GF2Matrix(g); }
public GF2Matrix getSInv() { return new GF2Matrix(encSInv); }
/** * Constructor. * @param n length of the code * @param t error correction capability * @param matrix generator matrix * @param digest McElieceCCA2Parameters */ public McElieceCCA2PublicKeyParameters(int n, int t, GF2Matrix matrix, String digest) { super(false, digest); this.n = n; this.t = t; this.matrixG = new GF2Matrix(matrix); }
/** * Constructor. * * @param n length of the code * @param t error correction capability * @param matrix generator matrix * @param params McElieceCCA2Parameters */ public McElieceCCA2PublicKeyParameters(String oid, int n, int t, GF2Matrix matrix, McElieceCCA2Parameters params) { super(false, params); this.oid = oid; this.n = n; this.t = t; this.matrixG = new GF2Matrix(matrix); }
/** * Constructor (used by {@link McElieceKeyFactory}). * * @param n length of the code * @param t error correction capability of the code * @param encMatrix encoded generator matrix * @param params McElieceCCA2Parameters */ public McElieceCCA2PublicKeyParameters(String oid, int n, int t, byte[] encMatrix, McElieceCCA2Parameters params) { super(false, params); this.oid = oid; this.n = n; this.t = t; this.matrixG = new GF2Matrix(encMatrix); }
/** * Constructor (used by {@link McElieceKeyFactory}). * * @param oid * @param n the length of the code * @param t the error correction capability of the code * @param g the generator matrix * @param params McElieceParameters */ public McEliecePublicKeyParameters(String oid, int n, int t, GF2Matrix g, McElieceParameters params) { super(false, params); this.oid = oid; this.n = n; this.t = t; this.g = new GF2Matrix(g); }
/** * Constructor (used by {@link McElieceKeyFactory}). * * @param oid * @param n the length of the code * @param t the error correction capability of the code * @param encG the encoded generator matrix * @param params McElieceParameters */ public McEliecePublicKeyParameters(String oid, int t, int n, byte[] encG, McElieceParameters params) { super(false, params); this.oid = oid; this.n = n; this.t = t; this.g = new GF2Matrix(encG); }
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; }
/** * Generates zero GF2 matrix with <rows> rows and <cols> columns. * @param rows * @param cols * @return */ public static GF2Matrix generateGF2Matrix(int rows, int cols){ return new GF2Matrix(generateGF2MatrixEncodedForm(rows, cols)); }
/** * Generates zero GF2 matrix with <rows> rows and <cols> columns. * @param rows * @param cols * @return */ public static GF2Matrix generateGF2Matrix(long rows, long cols){ return new GF2Matrix(generateGF2MatrixEncodedForm((int)rows, (int)cols)); }
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)) + "]"); } }
private McEliecePublicKey(ASN1Sequence seq) { BigInteger bigN = ((ASN1Integer)seq.getObjectAt(0)).getValue(); n = bigN.intValue(); BigInteger bigT = ((ASN1Integer)seq.getObjectAt(1)).getValue(); t = bigT.intValue(); g = new GF2Matrix(((ASN1OctetString)seq.getObjectAt(2)).getOctets()); }
private McElieceCCA2PublicKey(ASN1Sequence seq) { BigInteger bigN = ((ASN1Integer)seq.getObjectAt(0)).getValue(); n = bigN.intValue(); BigInteger bigT = ((ASN1Integer)seq.getObjectAt(1)).getValue(); t = bigT.intValue(); g = new GF2Matrix(((ASN1OctetString)seq.getObjectAt(2)).getOctets()); digest = AlgorithmIdentifier.getInstance(seq.getObjectAt(3)); }