package X3;

import com.google.crypto.tink.shaded.protobuf.AbstractC1254b;
import com.google.crypto.tink.shaded.protobuf.AbstractC1274w;
import com.google.crypto.tink.shaded.protobuf.C1256d;
import com.google.crypto.tink.shaded.protobuf.C1263k;
import com.google.crypto.tink.shaded.protobuf.C1267o;
import com.google.crypto.tink.shaded.protobuf.C1273v;
import com.google.crypto.tink.shaded.protobuf.InterfaceC1277z;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.List;
import m1.AbstractC2464a;

/* JADX INFO: loaded from: classes3.dex */
public final class g0 extends AbstractC1274w {
    private static final g0 DEFAULT_INSTANCE;
    public static final int KEY_FIELD_NUMBER = 2;
    private static volatile com.google.crypto.tink.shaded.protobuf.X PARSER = null;
    public static final int PRIMARY_KEY_ID_FIELD_NUMBER = 1;
    private InterfaceC1277z key_ = com.google.crypto.tink.shaded.protobuf.a0.f13762d;
    private int primaryKeyId_;

    static {
        g0 g0Var = new g0();
        DEFAULT_INSTANCE = g0Var;
        AbstractC1274w.s(g0.class, g0Var);
    }

    public static d0 B() {
        return (d0) DEFAULT_INSTANCE.g();
    }

    public static g0 C(ByteArrayInputStream byteArrayInputStream, C1267o c1267o) throws com.google.crypto.tink.shaded.protobuf.C {
        AbstractC1274w abstractC1274wR = AbstractC1274w.r(DEFAULT_INSTANCE, new C1263k(byteArrayInputStream), c1267o);
        AbstractC1274w.f(abstractC1274wR);
        return (g0) abstractC1274wR;
    }

    public static g0 D(byte[] bArr, C1267o c1267o) {
        g0 g0Var = DEFAULT_INSTANCE;
        int length = bArr.length;
        AbstractC1274w abstractC1274wP = g0Var.p();
        try {
            com.google.crypto.tink.shaded.protobuf.Z z6 = com.google.crypto.tink.shaded.protobuf.Z.f13759c;
            z6.getClass();
            com.google.crypto.tink.shaded.protobuf.c0 c0VarA = z6.a(abstractC1274wP.getClass());
            C1256d c1256d = new C1256d();
            c1267o.getClass();
            c0VarA.i(abstractC1274wP, bArr, 0, length, c1256d);
            c0VarA.b(abstractC1274wP);
            AbstractC1274w.f(abstractC1274wP);
            return (g0) abstractC1274wP;
        } catch (com.google.crypto.tink.shaded.protobuf.C e6) {
            if (e6.f13716a) {
                throw new com.google.crypto.tink.shaded.protobuf.C(e6.getMessage(), e6);
            }
            throw e6;
        } catch (com.google.crypto.tink.shaded.protobuf.e0 e7) {
            throw new com.google.crypto.tink.shaded.protobuf.C(e7.getMessage());
        } catch (IOException e8) {
            if (e8.getCause() instanceof com.google.crypto.tink.shaded.protobuf.C) {
                throw ((com.google.crypto.tink.shaded.protobuf.C) e8.getCause());
            }
            throw new com.google.crypto.tink.shaded.protobuf.C(e8.getMessage(), e8);
        } catch (IndexOutOfBoundsException unused) {
            throw com.google.crypto.tink.shaded.protobuf.C.g();
        }
    }

    public static void v(g0 g0Var, int i6) {
        g0Var.primaryKeyId_ = i6;
    }

    public static void w(g0 g0Var, f0 f0Var) {
        g0Var.getClass();
        InterfaceC1277z interfaceC1277z = g0Var.key_;
        if (!((AbstractC1254b) interfaceC1277z).f13765a) {
            int size = interfaceC1277z.size();
            g0Var.key_ = interfaceC1277z.a(size == 0 ? 10 : size * 2);
        }
        g0Var.key_.add(f0Var);
    }

    public final int A() {
        return this.primaryKeyId_;
    }

    @Override // com.google.crypto.tink.shaded.protobuf.AbstractC1274w
    public final Object h(int i6) {
        com.google.crypto.tink.shaded.protobuf.X c1273v;
        switch (AbstractC2464a.c(i6)) {
            case 0:
                return (byte) 1;
            case 1:
                return null;
            case 2:
                return new com.google.crypto.tink.shaded.protobuf.b0(DEFAULT_INSTANCE, "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0001\u0000\u0001\u000b\u0002\u001b", new Object[]{"primaryKeyId_", "key_", f0.class});
            case 3:
                return new g0();
            case 4:
                return new d0(DEFAULT_INSTANCE);
            case 5:
                return DEFAULT_INSTANCE;
            case 6:
                com.google.crypto.tink.shaded.protobuf.X x6 = PARSER;
                if (x6 != null) {
                    return x6;
                }
                synchronized (g0.class) {
                    try {
                        c1273v = PARSER;
                        if (c1273v == null) {
                            c1273v = new C1273v();
                            PARSER = c1273v;
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                    break;
                }
                return c1273v;
            default:
                throw new UnsupportedOperationException();
        }
    }

    public final f0 x(int i6) {
        return (f0) this.key_.get(i6);
    }

    public final int y() {
        return this.key_.size();
    }

    public final List z() {
        return this.key_;
    }
}
