what-the-bank/sources/org/bouncycastle/crypto/io/MacOutputStream.java

31 lines
740 B
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto.io;
import java.io.IOException;
import java.io.OutputStream;
import org.bouncycastle.crypto.Mac;
/* loaded from: classes6.dex */
public class MacOutputStream extends OutputStream {
protected Mac mac;
@Override // java.io.OutputStream
public void write(byte[] bArr, int i, int i2) throws IOException {
this.mac.update(bArr, i, i2);
}
@Override // java.io.OutputStream
public void write(int i) throws IOException {
this.mac.update((byte) i);
}
public byte[] getMac() {
byte[] bArr = new byte[this.mac.getMacSize()];
this.mac.doFinal(bArr, 0);
return bArr;
}
public MacOutputStream(Mac mac) {
this.mac = mac;
}
}