package com.google.android.gms.internal.ads;

import java.security.GeneralSecurityException;
import java.util.Objects;
import javax.crypto.Mac;

/* JADX INFO: loaded from: classes2.dex */
public final class z82 extends ThreadLocal {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f19143a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f19144b;

    public /* synthetic */ z82(Object obj, int i10) {
        this.f19143a = i10;
        this.f19144b = obj;
    }

    public final Mac a() {
        int i10 = this.f19143a;
        Object obj = this.f19144b;
        switch (i10) {
            case 0:
                try {
                    a92 a92Var = (a92) obj;
                    Mac mac = (Mac) w82.f17927c.a(a92Var.f8588c);
                    mac.init(a92Var.f8589d);
                    return mac;
                } catch (GeneralSecurityException e10) {
                    throw new IllegalStateException(e10);
                }
            default:
                try {
                    Mac mac2 = (Mac) com.google.android.gms.internal.pal.de.f20764f.a(((a92) obj).f8588c);
                    mac2.init(((a92) obj).f8589d);
                    return mac2;
                } catch (GeneralSecurityException e11) {
                    throw new IllegalStateException(e11);
                }
        }
    }

    @Override // java.lang.ThreadLocal
    public final Object initialValue() {
        switch (this.f19143a) {
            case 0:
                return a();
            case 1:
                return a();
            case 2:
                Object obj = this.f19144b;
                try {
                    sa.j jVar = sa.j.f32735c;
                    Mac mac = (Mac) jVar.f32736a.q(((sa.m) obj).f32738b);
                    mac.init(((sa.m) obj).f32739c);
                    return mac;
                } catch (GeneralSecurityException e10) {
                    throw new IllegalStateException(e10);
                }
            default:
                return new fe.c();
        }
    }

    public z82(a92 a92Var) {
        this.f19143a = 0;
        Objects.requireNonNull(a92Var);
        this.f19144b = a92Var;
    }
}
