package fa;

import com.google.crypto.tink.proto.OutputPrefixType;
import ea.q0;
import ea.s0;
import ea.t0;
import java.security.GeneralSecurityException;
import java.util.Objects;
import ma.p0;
import ma.v;
import ma.x;

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

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

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

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

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

    static {
        ta.a aVarC = p0.c("type.googleapis.com/google.crypto.tink.XAesGcmKey");
        f26027a = new x(new h(2), t0.class);
        f26028b = new v(new h(3), aVarC);
        f26029c = new ma.f(new h(4), q0.class);
        f26030d = new ma.d(new h(5), aVarC);
    }

    public static OutputPrefixType a(s0 s0Var) throws GeneralSecurityException {
        if (Objects.equals(s0Var, s0.f25754b)) {
            return OutputPrefixType.TINK;
        }
        if (Objects.equals(s0Var, s0.f25755c)) {
            return OutputPrefixType.RAW;
        }
        throw new GeneralSecurityException("Unable to serialize variant: " + s0Var);
    }

    public static s0 b(OutputPrefixType outputPrefixType) throws GeneralSecurityException {
        int iOrdinal = outputPrefixType.ordinal();
        if (iOrdinal == 1) {
            return s0.f25754b;
        }
        if (iOrdinal == 3) {
            return s0.f25755c;
        }
        throw new GeneralSecurityException("Unable to parse OutputPrefixType: " + outputPrefixType.b());
    }
}
