package org.bouncycastle.crypto.engines;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class NullEngine implements org.bouncycastle.crypto.BlockCipher {
    private boolean a;
    private final int b;

    @Override // org.bouncycastle.crypto.BlockCipher
    public int b() {
        return this.b;
    }

    @Override // org.bouncycastle.crypto.BlockCipher
    public int c(byte[] bArr, int i, byte[] bArr2, int i2) {
        if (!this.a) {
            throw new java.lang.IllegalStateException("Null engine not initialised");
        }
        int i3 = this.b;
        if (i + i3 > bArr.length) {
            throw new org.bouncycastle.crypto.DataLengthException("input buffer too short");
        }
        if (i3 + i2 > bArr2.length) {
            throw new org.bouncycastle.crypto.OutputLengthException("output buffer too short");
        }
        int i4 = 0;
        while (true) {
            int i5 = this.b;
            if (i4 >= i5) {
                return i5;
            }
            bArr2[i2 + i4] = bArr[i + i4];
            i4++;
        }
    }

    @Override // org.bouncycastle.crypto.BlockCipher
    public java.lang.String getAlgorithmName() {
        return "Null";
    }

    @Override // org.bouncycastle.crypto.BlockCipher
    public void init(boolean z, org.bouncycastle.crypto.CipherParameters cipherParameters) {
        this.a = true;
    }

    @Override // org.bouncycastle.crypto.BlockCipher
    public void reset() {
    }
}
