package o; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import org.bouncycastle.crypto.engines.AESEngine; import org.bouncycastle.crypto.prng.SP800SecureRandomBuilder; /* loaded from: classes2.dex */ public final class BAC { private static boolean d = true; public static SecureRandom d() { SecureRandom secureRandom; try { secureRandom = SecureRandom.getInstanceStrong(); } catch (NoSuchAlgorithmException unused) { secureRandom = null; } if (secureRandom == null) { try { secureRandom = SecureRandom.getInstance("SHA1PRNG"); } catch (NoSuchAlgorithmException unused2) { return secureRandom; } catch (Throwable th) { if (d) { th.getMessage(); d = false; } return secureRandom; } } AESEngine aESEngine = new AESEngine(); byte[] bArr = new byte[32]; secureRandom.nextBytes(bArr); return new SP800SecureRandomBuilder(secureRandom, true).setEntropyBitsRequired(384).buildCTR(aESEngine, 256, bArr, false); } }