what-the-bank/sources/org/bouncycastle/crypto/ec/ECUtil.java

23 lines
690 B
Java
Raw Normal View History

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