what-the-bank/sources/org/bouncycastle/crypto/digests/SkeinDigest.java

76 lines
2.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto.digests;
import org.bouncycastle.crypto.ExtendedDigest;
import org.bouncycastle.crypto.params.SkeinParameters;
import org.bouncycastle.util.Memoable;
/* loaded from: classes6.dex */
public class SkeinDigest implements ExtendedDigest, Memoable {
public static final int SKEIN_1024 = 1024;
public static final int SKEIN_256 = 256;
public static final int SKEIN_512 = 512;
private SkeinEngine engine;
@Override // org.bouncycastle.crypto.Digest
public void update(byte[] bArr, int i, int i2) {
this.engine.update(bArr, i, i2);
}
@Override // org.bouncycastle.crypto.Digest
public void update(byte b) {
this.engine.update(b);
}
@Override // org.bouncycastle.util.Memoable
public void reset(Memoable memoable) {
this.engine.reset(((SkeinDigest) memoable).engine);
}
@Override // org.bouncycastle.crypto.Digest
public void reset() {
this.engine.reset();
}
public void init(SkeinParameters skeinParameters) {
this.engine.init(skeinParameters);
}
@Override // org.bouncycastle.crypto.Digest
public int getDigestSize() {
return this.engine.getOutputSize();
}
@Override // org.bouncycastle.crypto.ExtendedDigest
public int getByteLength() {
return this.engine.getBlockSize();
}
@Override // org.bouncycastle.crypto.Digest
public String getAlgorithmName() {
StringBuilder sb = new StringBuilder("Skein-");
sb.append(this.engine.getBlockSize() << 3);
sb.append("-");
sb.append(this.engine.getOutputSize() << 3);
return sb.toString();
}
@Override // org.bouncycastle.crypto.Digest
public int doFinal(byte[] bArr, int i) {
return this.engine.doFinal(bArr, i);
}
@Override // org.bouncycastle.util.Memoable
public Memoable copy() {
return new SkeinDigest(this);
}
public SkeinDigest(SkeinDigest skeinDigest) {
this.engine = new SkeinEngine(skeinDigest.engine);
}
public SkeinDigest(int i, int i2) {
this.engine = new SkeinEngine(i, i2);
init(null);
}
}