package org.bouncycastle.crypto.generators;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class DHKeyPairGenerator implements org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator {
    private org.bouncycastle.crypto.params.DHKeyGenerationParameters g;

    @Override // org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator
    public org.bouncycastle.crypto.AsymmetricCipherKeyPair a() {
        org.bouncycastle.crypto.generators.DHKeyGeneratorHelper dHKeyGeneratorHelper = org.bouncycastle.crypto.generators.DHKeyGeneratorHelper.a;
        org.bouncycastle.crypto.params.DHParameters dHParametersC = this.g.c();
        java.math.BigInteger bigIntegerA = dHKeyGeneratorHelper.a(dHParametersC, this.g.a());
        return new org.bouncycastle.crypto.AsymmetricCipherKeyPair(new org.bouncycastle.crypto.params.DHPublicKeyParameters(dHKeyGeneratorHelper.b(dHParametersC, bigIntegerA), dHParametersC), new org.bouncycastle.crypto.params.DHPrivateKeyParameters(bigIntegerA, dHParametersC));
    }

    @Override // org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator
    public void b(org.bouncycastle.crypto.KeyGenerationParameters keyGenerationParameters) {
        org.bouncycastle.crypto.params.DHKeyGenerationParameters dHKeyGenerationParameters = (org.bouncycastle.crypto.params.DHKeyGenerationParameters) keyGenerationParameters;
        this.g = dHKeyGenerationParameters;
        org.bouncycastle.crypto.CryptoServicesRegistrar.a(new org.bouncycastle.crypto.constraints.DefaultServiceProperties("DHKeyGen", org.bouncycastle.crypto.constraints.ConstraintUtils.a(dHKeyGenerationParameters.c().f()), this.g.c(), org.bouncycastle.crypto.CryptoServicePurpose.KEYGEN));
    }
}
