what-the-bank/sources/org/bouncycastle/pqc/math/linearalgebra/RandUtils.java

21 lines
596 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.pqc.math.linearalgebra;
import java.security.SecureRandom;
/* loaded from: classes6.dex */
public class RandUtils {
/* JADX INFO: Access modifiers changed from: package-private */
public static int nextInt(SecureRandom secureRandom, int i) {
int nextInt;
int i2;
if (((-i) & i) == i) {
return (int) ((i * (secureRandom.nextInt() >>> 1)) >> 31);
}
do {
nextInt = secureRandom.nextInt() >>> 1;
i2 = nextInt % i;
} while ((nextInt - i2) + (i - 1) < 0);
return i2;
}
}