package org.bouncycastle.crypto.params;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class ECDHUPrivateParameters implements org.bouncycastle.crypto.CipherParameters {
    private org.bouncycastle.crypto.params.ECPrivateKeyParameters a;
    private org.bouncycastle.crypto.params.ECPrivateKeyParameters b;
    private org.bouncycastle.crypto.params.ECPublicKeyParameters c;

    public ECDHUPrivateParameters(org.bouncycastle.crypto.params.ECPrivateKeyParameters eCPrivateKeyParameters, org.bouncycastle.crypto.params.ECPrivateKeyParameters eCPrivateKeyParameters2, org.bouncycastle.crypto.params.ECPublicKeyParameters eCPublicKeyParameters) {
        if (eCPrivateKeyParameters == null) {
            throw new java.lang.NullPointerException("staticPrivateKey cannot be null");
        }
        if (eCPrivateKeyParameters2 == null) {
            throw new java.lang.NullPointerException("ephemeralPrivateKey cannot be null");
        }
        org.bouncycastle.crypto.params.ECDomainParameters eCDomainParametersG = eCPrivateKeyParameters.g();
        if (!eCDomainParametersG.equals(eCPrivateKeyParameters2.g())) {
            throw new java.lang.IllegalArgumentException("static and ephemeral private keys have different domain parameters");
        }
        if (eCPublicKeyParameters == null) {
            eCPublicKeyParameters = new org.bouncycastle.crypto.params.ECPublicKeyParameters(new org.bouncycastle.math.ec.FixedPointCombMultiplier().a(eCDomainParametersG.b(), eCPrivateKeyParameters2.h()), eCDomainParametersG);
        } else if (!eCDomainParametersG.equals(eCPublicKeyParameters.g())) {
            throw new java.lang.IllegalArgumentException("ephemeral public key has different domain parameters");
        }
        this.a = eCPrivateKeyParameters;
        this.b = eCPrivateKeyParameters2;
        this.c = eCPublicKeyParameters;
    }

    public org.bouncycastle.crypto.params.ECPrivateKeyParameters a() {
        return this.b;
    }

    public org.bouncycastle.crypto.params.ECPrivateKeyParameters b() {
        return this.a;
    }
}
