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

25 lines
854 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
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));
}
}