what-the-bank/sources/org/bouncycastle/crypto/params/ECDomainParameters.java

68 lines
2.0 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto.params;
import java.math.BigInteger;
import org.bouncycastle.math.ec.ECConstants;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.util.Arrays;
/* loaded from: classes6.dex */
public class ECDomainParameters implements ECConstants {
private ECPoint G;
private ECCurve curve;
private BigInteger h;
private BigInteger n;
private byte[] seed;
public int hashCode() {
return (((((this.curve.hashCode() * 37) ^ this.G.hashCode()) * 37) ^ this.n.hashCode()) * 37) ^ this.h.hashCode();
}
public byte[] getSeed() {
return Arrays.clone(this.seed);
}
public BigInteger getN() {
return this.n;
}
public BigInteger getH() {
return this.h;
}
public ECPoint getG() {
return this.G;
}
public ECCurve getCurve() {
return this.curve;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ECDomainParameters)) {
return false;
}
ECDomainParameters eCDomainParameters = (ECDomainParameters) obj;
return this.curve.equals(eCDomainParameters.curve) && this.G.equals(eCDomainParameters.G) && this.n.equals(eCDomainParameters.n) && this.h.equals(eCDomainParameters.h);
}
public ECDomainParameters(ECCurve eCCurve, ECPoint eCPoint, BigInteger bigInteger, BigInteger bigInteger2, byte[] bArr) {
this.curve = eCCurve;
this.G = eCPoint.normalize();
this.n = bigInteger;
this.h = bigInteger2;
this.seed = bArr;
}
public ECDomainParameters(ECCurve eCCurve, ECPoint eCPoint, BigInteger bigInteger, BigInteger bigInteger2) {
this(eCCurve, eCPoint, bigInteger, bigInteger2, null);
}
public ECDomainParameters(ECCurve eCCurve, ECPoint eCPoint, BigInteger bigInteger) {
this(eCCurve, eCPoint, bigInteger, ONE, null);
}
}