31 lines
740 B
Java
31 lines
740 B
Java
|
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;
|
||
|
}
|
||
|
}
|