89 lines
2.7 KiB
Java
89 lines
2.7 KiB
Java
package org.bouncycastle.pqc.crypto.mceliece;
|
|
|
|
import org.bouncycastle.pqc.math.linearalgebra.GF2Matrix;
|
|
import org.bouncycastle.pqc.math.linearalgebra.GF2mField;
|
|
import org.bouncycastle.pqc.math.linearalgebra.GoppaCode;
|
|
import org.bouncycastle.pqc.math.linearalgebra.Permutation;
|
|
import org.bouncycastle.pqc.math.linearalgebra.PolynomialGF2mSmallM;
|
|
import org.bouncycastle.pqc.math.linearalgebra.PolynomialRingGF2m;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public class McEliecePrivateKeyParameters extends McElieceKeyParameters {
|
|
private GF2mField field;
|
|
private PolynomialGF2mSmallM goppaPoly;
|
|
private GF2Matrix h;
|
|
private int k;
|
|
private int n;
|
|
private String oid;
|
|
private Permutation p1;
|
|
private Permutation p2;
|
|
private PolynomialGF2mSmallM[] qInv;
|
|
private GF2Matrix sInv;
|
|
|
|
public GF2Matrix getSInv() {
|
|
return this.sInv;
|
|
}
|
|
|
|
public PolynomialGF2mSmallM[] getQInv() {
|
|
return this.qInv;
|
|
}
|
|
|
|
public Permutation getP2() {
|
|
return this.p2;
|
|
}
|
|
|
|
public Permutation getP1() {
|
|
return this.p1;
|
|
}
|
|
|
|
public int getN() {
|
|
return this.n;
|
|
}
|
|
|
|
public int getK() {
|
|
return this.k;
|
|
}
|
|
|
|
public GF2Matrix getH() {
|
|
return this.h;
|
|
}
|
|
|
|
public PolynomialGF2mSmallM getGoppaPoly() {
|
|
return this.goppaPoly;
|
|
}
|
|
|
|
public GF2mField getField() {
|
|
return this.field;
|
|
}
|
|
|
|
public McEliecePrivateKeyParameters(int i, int i2, byte[] bArr, byte[] bArr2, byte[] bArr3, byte[] bArr4, byte[] bArr5, byte[] bArr6, byte[][] bArr7) {
|
|
super(true, null);
|
|
this.n = i;
|
|
this.k = i2;
|
|
GF2mField gF2mField = new GF2mField(bArr);
|
|
this.field = gF2mField;
|
|
this.goppaPoly = new PolynomialGF2mSmallM(gF2mField, bArr2);
|
|
this.sInv = new GF2Matrix(bArr3);
|
|
this.p1 = new Permutation(bArr4);
|
|
this.p2 = new Permutation(bArr5);
|
|
this.h = new GF2Matrix(bArr6);
|
|
this.qInv = new PolynomialGF2mSmallM[bArr7.length];
|
|
for (int i3 = 0; i3 < bArr7.length; i3++) {
|
|
this.qInv[i3] = new PolynomialGF2mSmallM(this.field, bArr7[i3]);
|
|
}
|
|
}
|
|
|
|
public McEliecePrivateKeyParameters(int i, int i2, GF2mField gF2mField, PolynomialGF2mSmallM polynomialGF2mSmallM, Permutation permutation, Permutation permutation2, GF2Matrix gF2Matrix) {
|
|
super(true, null);
|
|
this.k = i2;
|
|
this.n = i;
|
|
this.field = gF2mField;
|
|
this.goppaPoly = polynomialGF2mSmallM;
|
|
this.sInv = gF2Matrix;
|
|
this.p1 = permutation;
|
|
this.p2 = permutation2;
|
|
this.h = GoppaCode.createCanonicalCheckMatrix(gF2mField, polynomialGF2mSmallM);
|
|
this.qInv = new PolynomialRingGF2m(gF2mField, polynomialGF2mSmallM).getSquareRootMatrix();
|
|
}
|
|
}
|