what-the-bank/sources/org/bouncycastle/crypto/prng/drbg/DualECPoints.java

57 lines
1.3 KiB
Java

package org.bouncycastle.crypto.prng.drbg;
import org.bouncycastle.math.ec.ECPoint;
/* loaded from: classes6.dex */
public class DualECPoints {
private final int cofactor;
private final ECPoint p;
private final ECPoint q;
private final int securityStrength;
private static int log2(int i) {
int i2 = 0;
while (true) {
i >>= 1;
if (i == 0) {
return i2;
}
i2++;
}
}
public int getSeedLen() {
return this.p.getCurve().getFieldSize();
}
public int getSecurityStrength() {
return this.securityStrength;
}
public ECPoint getQ() {
return this.q;
}
public ECPoint getP() {
return this.p;
}
public int getMaxOutlen() {
return ((this.p.getCurve().getFieldSize() - (log2(this.cofactor) + 13)) / 8) << 3;
}
public int getCofactor() {
return this.cofactor;
}
public DualECPoints(int i, ECPoint eCPoint, ECPoint eCPoint2, int i2) {
if (!eCPoint.getCurve().equals(eCPoint2.getCurve())) {
throw new IllegalArgumentException("points need to be on the same curve");
}
this.securityStrength = i;
this.p = eCPoint;
this.q = eCPoint2;
this.cofactor = i2;
}
}