package fa;

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

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

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

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

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

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

    static {
        ta.a aVarC = p0.c("type.googleapis.com/google.crypto.tink.AesGcmSivKey");
        f26001a = new x(new androidx.core.view.n(24), y.class);
        f26002b = new v(new androidx.core.view.n(25), aVarC);
        f26003c = new ma.f(new androidx.core.view.n(26), ea.v.class);
        f26004d = new ma.d(new androidx.core.view.n(27), aVarC);
    }

    public static OutputPrefixType a(ea.x xVar) throws GeneralSecurityException {
        if (ea.x.f25787b.equals(xVar)) {
            return OutputPrefixType.TINK;
        }
        if (ea.x.f25788c.equals(xVar)) {
            return OutputPrefixType.CRUNCHY;
        }
        if (ea.x.f25789d.equals(xVar)) {
            return OutputPrefixType.RAW;
        }
        throw new GeneralSecurityException("Unable to serialize variant: " + xVar);
    }

    public static ea.x b(OutputPrefixType outputPrefixType) throws GeneralSecurityException {
        int iOrdinal = outputPrefixType.ordinal();
        if (iOrdinal == 1) {
            return ea.x.f25787b;
        }
        if (iOrdinal != 2) {
            if (iOrdinal == 3) {
                return ea.x.f25789d;
            }
            if (iOrdinal != 4) {
                throw new GeneralSecurityException("Unable to parse OutputPrefixType: " + outputPrefixType.b());
            }
        }
        return ea.x.f25788c;
    }
}
