package p138.p329.p357.p359;

import com.hierynomus.security.SecurityException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Provider;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import p138.p329.p357.InterfaceC6310;

/* JADX INFO: renamed from: ދ.ށ.އ.ރ.ؠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C6328 implements InterfaceC6310 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final String f17664;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public Mac f17665;

    public C6328(String str, Provider provider, String str2) throws SecurityException {
        this.f17664 = str;
        try {
            if (provider != null) {
                this.f17665 = Mac.getInstance(str, provider);
            } else if (str2 != null) {
                this.f17665 = Mac.getInstance(str, str2);
            } else {
                this.f17665 = Mac.getInstance(str);
            }
        } catch (NoSuchAlgorithmException e) {
            e = e;
            throw new SecurityException(e);
        } catch (NoSuchProviderException e2) {
            e = e2;
            throw new SecurityException(e);
        }
    }

    @Override // p138.p329.p357.InterfaceC6310
    /* JADX INFO: renamed from: ֏ */
    public void mo9544(byte b) {
        this.f17665.update(b);
    }

    @Override // p138.p329.p357.InterfaceC6310
    /* JADX INFO: renamed from: ֏ */
    public void mo9545(byte[] bArr) {
        this.f17665.update(bArr);
    }

    @Override // p138.p329.p357.InterfaceC6310
    /* JADX INFO: renamed from: ֏ */
    public void mo9546(byte[] bArr, int i, int i2) {
        this.f17665.update(bArr, i, i2);
    }

    @Override // p138.p329.p357.InterfaceC6310
    /* JADX INFO: renamed from: ֏ */
    public byte[] mo9547() {
        return this.f17665.doFinal();
    }

    @Override // p138.p329.p357.InterfaceC6310
    /* JADX INFO: renamed from: ؠ */
    public void mo9548(byte[] bArr) throws SecurityException {
        try {
            this.f17665.init(new SecretKeySpec(bArr, this.f17664));
        } catch (InvalidKeyException e) {
            throw new SecurityException(e);
        }
    }
}
