what-the-bank/sources/org/bouncycastle/crypto/generators/ElGamalParametersGenerator....

25 lines
854 B
Java

package org.bouncycastle.crypto.generators;
import java.math.BigInteger;
import java.security.SecureRandom;
import org.bouncycastle.crypto.params.ElGamalParameters;
/* loaded from: classes6.dex */
public class ElGamalParametersGenerator {
private int certainty;
private SecureRandom random;
private int size;
public void init(int i, int i2, SecureRandom secureRandom) {
this.size = i;
this.certainty = i2;
this.random = secureRandom;
}
public ElGamalParameters generateParameters() {
BigInteger[] generateSafePrimes = DHParametersHelper.generateSafePrimes(this.size, this.certainty, this.random);
BigInteger bigInteger = generateSafePrimes[0];
return new ElGamalParameters(bigInteger, DHParametersHelper.selectGenerator(bigInteger, generateSafePrimes[1], this.random));
}
}