package F2;

import com.google.crypto.tink.shaded.protobuf.AbstractC0473b;
import com.google.crypto.tink.shaded.protobuf.AbstractC0492v;
import com.google.crypto.tink.shaded.protobuf.C0481j;
import com.google.crypto.tink.shaded.protobuf.C0485n;
import com.google.crypto.tink.shaded.protobuf.C0491u;
import com.google.crypto.tink.shaded.protobuf.InterfaceC0495y;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public final class g0 extends AbstractC0492v {
    private static final g0 DEFAULT_INSTANCE;
    public static final int KEY_FIELD_NUMBER = 2;
    private static volatile com.google.crypto.tink.shaded.protobuf.W PARSER = null;
    public static final int PRIMARY_KEY_ID_FIELD_NUMBER = 1;
    private InterfaceC0495y key_ = com.google.crypto.tink.shaded.protobuf.Z.f5734n;
    private int primaryKeyId_;

    static {
        g0 g0Var = new g0();
        DEFAULT_INSTANCE = g0Var;
        AbstractC0492v.t(g0.class, g0Var);
    }

    public static d0 C() {
        return (d0) DEFAULT_INSTANCE.h();
    }

    public static g0 D(ByteArrayInputStream byteArrayInputStream, C0485n c0485n) throws com.google.crypto.tink.shaded.protobuf.B {
        AbstractC0492v abstractC0492vS = AbstractC0492v.s(DEFAULT_INSTANCE, new C0481j(byteArrayInputStream), c0485n);
        AbstractC0492v.g(abstractC0492vS);
        return (g0) abstractC0492vS;
    }

    public static g0 E(byte[] bArr, C0485n c0485n) {
        g0 g0Var = DEFAULT_INSTANCE;
        int length = bArr.length;
        AbstractC0492v abstractC0492vQ = g0Var.q();
        try {
            com.google.crypto.tink.shaded.protobuf.Y y5 = com.google.crypto.tink.shaded.protobuf.Y.f5731c;
            y5.getClass();
            com.google.crypto.tink.shaded.protobuf.b0 b0VarA = y5.a(abstractC0492vQ.getClass());
            Y0.b bVar = new Y0.b();
            c0485n.getClass();
            b0VarA.f(abstractC0492vQ, bArr, 0, length, bVar);
            b0VarA.b(abstractC0492vQ);
            AbstractC0492v.g(abstractC0492vQ);
            return (g0) abstractC0492vQ;
        } catch (com.google.crypto.tink.shaded.protobuf.B e2) {
            if (e2.f5690k) {
                throw new com.google.crypto.tink.shaded.protobuf.B(e2.getMessage(), e2);
            }
            throw e2;
        } catch (com.google.crypto.tink.shaded.protobuf.d0 e6) {
            throw new com.google.crypto.tink.shaded.protobuf.B(e6.getMessage());
        } catch (IOException e7) {
            if (e7.getCause() instanceof com.google.crypto.tink.shaded.protobuf.B) {
                throw ((com.google.crypto.tink.shaded.protobuf.B) e7.getCause());
            }
            throw new com.google.crypto.tink.shaded.protobuf.B(e7.getMessage(), e7);
        } catch (IndexOutOfBoundsException unused) {
            throw com.google.crypto.tink.shaded.protobuf.B.g();
        }
    }

    public static void w(g0 g0Var, int i) {
        g0Var.primaryKeyId_ = i;
    }

    public static void x(g0 g0Var, f0 f0Var) {
        g0Var.getClass();
        InterfaceC0495y interfaceC0495y = g0Var.key_;
        if (!((AbstractC0473b) interfaceC0495y).f5741k) {
            int size = interfaceC0495y.size();
            g0Var.key_ = interfaceC0495y.e(size == 0 ? 10 : size * 2);
        }
        g0Var.key_.add(f0Var);
    }

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

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

    @Override // com.google.crypto.tink.shaded.protobuf.AbstractC0492v
    public final Object i(int i) {
        com.google.crypto.tink.shaded.protobuf.W c0491u;
        switch (u.e.c(i)) {
            case 0:
                return (byte) 1;
            case 1:
                return null;
            case 2:
                return new com.google.crypto.tink.shaded.protobuf.a0(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.W w5 = PARSER;
                if (w5 != null) {
                    return w5;
                }
                synchronized (g0.class) {
                    try {
                        c0491u = PARSER;
                        if (c0491u == null) {
                            c0491u = new C0491u();
                            PARSER = c0491u;
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                    break;
                }
                return c0491u;
            default:
                throw new UnsupportedOperationException();
        }
    }

    public final f0 y(int i) {
        return (f0) this.key_.get(i);
    }

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