package org.bouncycastle.crypto.digests;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class ShortenedDigest implements org.bouncycastle.crypto.ExtendedDigest {
    private org.bouncycastle.crypto.ExtendedDigest a;
    private int b;

    @Override // org.bouncycastle.crypto.Digest
    public int doFinal(byte[] bArr, int i) {
        byte[] bArr2 = new byte[this.a.getDigestSize()];
        this.a.doFinal(bArr2, 0);
        java.lang.System.arraycopy(bArr2, 0, bArr, i, this.b);
        return this.b;
    }

    @Override // org.bouncycastle.crypto.Digest
    public java.lang.String getAlgorithmName() {
        return this.a.getAlgorithmName() + "(" + (this.b * 8) + ")";
    }

    @Override // org.bouncycastle.crypto.ExtendedDigest
    public int getByteLength() {
        return this.a.getByteLength();
    }

    @Override // org.bouncycastle.crypto.Digest
    public int getDigestSize() {
        return this.b;
    }

    @Override // org.bouncycastle.crypto.Digest
    public void reset() {
        this.a.reset();
    }

    @Override // org.bouncycastle.crypto.Digest
    public void update(byte b) {
        this.a.update(b);
    }

    @Override // org.bouncycastle.crypto.Digest
    public void update(byte[] bArr, int i, int i2) {
        this.a.update(bArr, i, i2);
    }
}
