package la;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.ProviderException;
import javax.crypto.BadPaddingException;

/* JADX INFO: loaded from: classes2.dex */
public final class d implements da.a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final c f30196a;

    public d(String str) throws GeneralSecurityException {
        try {
            KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
            keyStore.load(null);
            this.f30196a = new c(str, keyStore);
        } catch (IOException e10) {
            throw new GeneralSecurityException(e10);
        }
    }

    @Override // da.a
    public final byte[] a(byte[] bArr, byte[] bArr2) {
        c cVar = this.f30196a;
        try {
            return cVar.a(bArr, bArr2);
        } catch (GeneralSecurityException | ProviderException unused) {
            try {
                Thread.sleep((int) (Math.random() * 100.0d));
            } catch (InterruptedException unused2) {
            }
            return cVar.a(bArr, bArr2);
        }
    }

    @Override // da.a
    public final byte[] b(byte[] bArr, byte[] bArr2) throws BadPaddingException {
        c cVar = this.f30196a;
        try {
            return cVar.b(bArr, bArr2);
        } catch (BadPaddingException e10) {
            throw e10;
        } catch (GeneralSecurityException | ProviderException unused) {
            try {
                Thread.sleep((int) (Math.random() * 100.0d));
            } catch (InterruptedException unused2) {
            }
            return cVar.b(bArr, bArr2);
        }
    }
}
