package org.bouncycastle.crypto.digests;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class SkeinDigest implements org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.util.Memoable {
    private final org.bouncycastle.crypto.CryptoServicePurpose a;
    private org.bouncycastle.crypto.digests.SkeinEngine b;

    public SkeinDigest(int i, int i2) {
        this(i, i2, org.bouncycastle.crypto.CryptoServicePurpose.ANY);
    }

    public org.bouncycastle.util.Memoable a() {
        return new org.bouncycastle.crypto.digests.SkeinDigest(this);
    }

    public void d(org.bouncycastle.util.Memoable memoable) {
        this.b.d(((org.bouncycastle.crypto.digests.SkeinDigest) memoable).b);
    }

    @Override // org.bouncycastle.crypto.Digest
    public int doFinal(byte[] bArr, int i) {
        return this.b.g(bArr, i);
    }

    public void e(org.bouncycastle.crypto.params.SkeinParameters skeinParameters) {
        this.b.j(skeinParameters);
    }

    @Override // org.bouncycastle.crypto.Digest
    public java.lang.String getAlgorithmName() {
        return "Skein-" + (this.b.h() * 8) + "-" + (this.b.i() * 8);
    }

    @Override // org.bouncycastle.crypto.ExtendedDigest
    public int getByteLength() {
        return this.b.h();
    }

    @Override // org.bouncycastle.crypto.Digest
    public int getDigestSize() {
        return this.b.i();
    }

    @Override // org.bouncycastle.crypto.Digest
    public void reset() {
        this.b.n();
    }

    @Override // org.bouncycastle.crypto.Digest
    public void update(byte b) {
        this.b.s(b);
    }

    public SkeinDigest(int i, int i2, org.bouncycastle.crypto.CryptoServicePurpose cryptoServicePurpose) {
        this.b = new org.bouncycastle.crypto.digests.SkeinEngine(i, i2);
        this.a = cryptoServicePurpose;
        e(null);
        org.bouncycastle.crypto.CryptoServicesRegistrar.a(org.bouncycastle.crypto.digests.Utils.a(this, getDigestSize() * 4, cryptoServicePurpose));
    }

    @Override // org.bouncycastle.crypto.Digest
    public void update(byte[] bArr, int i, int i2) {
        this.b.t(bArr, i, i2);
    }

    public SkeinDigest(org.bouncycastle.crypto.digests.SkeinDigest skeinDigest) {
        this.b = new org.bouncycastle.crypto.digests.SkeinEngine(skeinDigest.b);
        org.bouncycastle.crypto.CryptoServicePurpose cryptoServicePurpose = skeinDigest.a;
        this.a = cryptoServicePurpose;
        org.bouncycastle.crypto.CryptoServicesRegistrar.a(org.bouncycastle.crypto.digests.Utils.a(this, skeinDigest.getDigestSize() * 4, cryptoServicePurpose));
    }
}
