package fa;

import com.google.crypto.tink.proto.OutputPrefixType;
import ea.b0;
import ea.c0;
import ea.z;
import java.security.GeneralSecurityException;
import ma.p0;
import ma.v;
import ma.x;

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

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

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

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

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

    static {
        ta.a aVarC = p0.c("type.googleapis.com/google.crypto.tink.ChaCha20Poly1305Key");
        f26012a = new x(new androidx.core.view.n(28), c0.class);
        f26013b = new v(new androidx.core.view.n(29), aVarC);
        f26014c = new ma.f(new h(0), z.class);
        f26015d = new ma.d(new h(1), aVarC);
    }

    public static OutputPrefixType a(b0 b0Var) throws GeneralSecurityException {
        if (b0.f25630b.equals(b0Var)) {
            return OutputPrefixType.TINK;
        }
        if (b0.f25631c.equals(b0Var)) {
            return OutputPrefixType.CRUNCHY;
        }
        if (b0.f25632d.equals(b0Var)) {
            return OutputPrefixType.RAW;
        }
        throw new GeneralSecurityException("Unable to serialize variant: " + b0Var);
    }

    public static b0 b(OutputPrefixType outputPrefixType) throws GeneralSecurityException {
        int iOrdinal = outputPrefixType.ordinal();
        if (iOrdinal == 1) {
            return b0.f25630b;
        }
        if (iOrdinal != 2) {
            if (iOrdinal == 3) {
                return b0.f25632d;
            }
            if (iOrdinal != 4) {
                throw new GeneralSecurityException("Unable to parse OutputPrefixType: " + outputPrefixType.b());
            }
        }
        return b0.f25631c;
    }
}
