23 lines
690 B
Java
23 lines
690 B
Java
|
package org.bouncycastle.crypto.ec;
|
||
|
|
||
|
import java.math.BigInteger;
|
||
|
import java.security.SecureRandom;
|
||
|
import org.bouncycastle.math.ec.ECConstants;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
class ECUtil {
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static BigInteger generateK(BigInteger bigInteger, SecureRandom secureRandom) {
|
||
|
int bitLength = bigInteger.bitLength();
|
||
|
while (true) {
|
||
|
BigInteger bigInteger2 = new BigInteger(bitLength, secureRandom);
|
||
|
if (!bigInteger2.equals(ECConstants.ZERO) && bigInteger2.compareTo(bigInteger) < 0) {
|
||
|
return bigInteger2;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
ECUtil() {
|
||
|
}
|
||
|
}
|