package org.bouncycastle.crypto.prng;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class X931SecureRandom extends java.security.SecureRandom {
    private final boolean a;
    private final java.security.SecureRandom b;
    private final org.bouncycastle.crypto.prng.X931RNG c;

    @Override // java.security.SecureRandom
    public byte[] generateSeed(int i) {
        return org.bouncycastle.crypto.prng.EntropyUtil.a(this.c.b(), i);
    }

    @Override // java.security.SecureRandom, java.util.Random
    public void nextBytes(byte[] bArr) {
        synchronized (this) {
            try {
                if (this.c.a(bArr, this.a) < 0) {
                    this.c.f();
                    this.c.a(bArr, this.a);
                }
            } catch (java.lang.Throwable th) {
                throw th;
            }
        }
    }

    @Override // java.security.SecureRandom, java.util.Random
    public void setSeed(long j) {
        synchronized (this) {
            try {
                java.security.SecureRandom secureRandom = this.b;
                if (secureRandom != null) {
                    secureRandom.setSeed(j);
                }
            } catch (java.lang.Throwable th) {
                throw th;
            }
        }
    }

    @Override // java.security.SecureRandom
    public void setSeed(byte[] bArr) {
        synchronized (this) {
            try {
                java.security.SecureRandom secureRandom = this.b;
                if (secureRandom != null) {
                    secureRandom.setSeed(bArr);
                }
            } catch (java.lang.Throwable th) {
                throw th;
            }
        }
    }
}
