package org.bouncycastle.crypto.engines;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class RSAEngine implements org.bouncycastle.crypto.AsymmetricBlockCipher {
    private org.bouncycastle.crypto.engines.RSACoreEngine a;

    @Override // org.bouncycastle.crypto.AsymmetricBlockCipher
    public int getInputBlockSize() {
        return this.a.c();
    }

    @Override // org.bouncycastle.crypto.AsymmetricBlockCipher
    public int getOutputBlockSize() {
        return this.a.d();
    }

    @Override // org.bouncycastle.crypto.AsymmetricBlockCipher
    public void init(boolean z, org.bouncycastle.crypto.CipherParameters cipherParameters) {
        if (this.a == null) {
            this.a = new org.bouncycastle.crypto.engines.RSACoreEngine();
        }
        this.a.f(z, cipherParameters);
    }

    @Override // org.bouncycastle.crypto.AsymmetricBlockCipher
    public byte[] processBlock(byte[] bArr, int i, int i2) {
        org.bouncycastle.crypto.engines.RSACoreEngine rSACoreEngine = this.a;
        if (rSACoreEngine != null) {
            return rSACoreEngine.b(rSACoreEngine.g(rSACoreEngine.a(bArr, i, i2)));
        }
        throw new java.lang.IllegalStateException("RSA engine not initialised");
    }
}
