package ka;

import com.google.crypto.tink.proto.OutputPrefixType;
import fa.h;
import ja.c;
import java.security.GeneralSecurityException;
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import ma.d;
import ma.f;
import ma.p0;
import ma.v;
import ma.x;

/* JADX INFO: loaded from: classes2.dex */
public abstract class a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final x f29087a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final v f29088b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final f f29089c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final d f29090d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final Map f29091e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final Map f29092f;

    static {
        ta.a aVarC = p0.c("type.googleapis.com/google.crypto.tink.AesSivKey");
        f29087a = new x(new h(14), ja.d.class);
        f29088b = new v(new h(15), aVarC);
        f29089c = new f(new h(16), ja.a.class);
        f29090d = new d(new h(17), aVarC);
        HashMap map = new HashMap();
        c cVar = c.f28734d;
        OutputPrefixType outputPrefixType = OutputPrefixType.RAW;
        map.put(cVar, outputPrefixType);
        c cVar2 = c.f28732b;
        OutputPrefixType outputPrefixType2 = OutputPrefixType.TINK;
        map.put(cVar2, outputPrefixType2);
        c cVar3 = c.f28733c;
        OutputPrefixType outputPrefixType3 = OutputPrefixType.CRUNCHY;
        map.put(cVar3, outputPrefixType3);
        f29091e = Collections.unmodifiableMap(map);
        EnumMap enumMap = new EnumMap(OutputPrefixType.class);
        enumMap.put(outputPrefixType, cVar);
        enumMap.put(outputPrefixType2, cVar2);
        enumMap.put(outputPrefixType3, cVar3);
        enumMap.put(OutputPrefixType.LEGACY, cVar3);
        f29092f = Collections.unmodifiableMap(enumMap);
    }

    public static OutputPrefixType a(c cVar) throws GeneralSecurityException {
        Map map = f29091e;
        if (map.containsKey(cVar)) {
            return (OutputPrefixType) map.get(cVar);
        }
        throw new GeneralSecurityException("Unable to serialize variant: " + cVar);
    }

    public static c b(OutputPrefixType outputPrefixType) throws GeneralSecurityException {
        Map map = f29092f;
        if (map.containsKey(outputPrefixType)) {
            return (c) map.get(outputPrefixType);
        }
        throw new GeneralSecurityException("Unable to parse OutputPrefixType: " + outputPrefixType.b());
    }
}
