package T3;

import com.google.crypto.tink.shaded.protobuf.AbstractC0736b;
import com.google.crypto.tink.shaded.protobuf.AbstractC0755v;
import com.google.crypto.tink.shaded.protobuf.C0744j;
import com.google.crypto.tink.shaded.protobuf.C0748n;
import com.google.crypto.tink.shaded.protobuf.C0754u;
import com.google.crypto.tink.shaded.protobuf.InterfaceC0758y;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.List;
import u.AbstractC1563h;

/* JADX INFO: loaded from: classes.dex */
public final class g0 extends AbstractC0755v {
    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 InterfaceC0758y key_ = com.google.crypto.tink.shaded.protobuf.Z.f10471t;
    private int primaryKeyId_;

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

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

    public static g0 D(ByteArrayInputStream byteArrayInputStream, C0748n c0748n) throws com.google.crypto.tink.shaded.protobuf.B {
        AbstractC0755v abstractC0755vS = AbstractC0755v.s(DEFAULT_INSTANCE, new C0744j(byteArrayInputStream), c0748n);
        AbstractC0755v.g(abstractC0755vS);
        return (g0) abstractC0755vS;
    }

    public static g0 E(byte[] bArr, C0748n c0748n) {
        g0 g0Var = DEFAULT_INSTANCE;
        int length = bArr.length;
        AbstractC0755v abstractC0755vQ = g0Var.q();
        try {
            com.google.crypto.tink.shaded.protobuf.Y y8 = com.google.crypto.tink.shaded.protobuf.Y.f10468c;
            y8.getClass();
            com.google.crypto.tink.shaded.protobuf.b0 b0VarA = y8.a(abstractC0755vQ.getClass());
            H0.g gVar = new H0.g();
            c0748n.getClass();
            b0VarA.g(abstractC0755vQ, bArr, 0, length, gVar);
            b0VarA.d(abstractC0755vQ);
            AbstractC0755v.g(abstractC0755vQ);
            return (g0) abstractC0755vQ;
        } catch (com.google.crypto.tink.shaded.protobuf.B e8) {
            if (e8.f10424q) {
                throw new com.google.crypto.tink.shaded.protobuf.B(e8.getMessage(), e8);
            }
            throw e8;
        } catch (com.google.crypto.tink.shaded.protobuf.d0 e9) {
            throw new com.google.crypto.tink.shaded.protobuf.B(e9.getMessage());
        } catch (IOException e10) {
            if (e10.getCause() instanceof com.google.crypto.tink.shaded.protobuf.B) {
                throw ((com.google.crypto.tink.shaded.protobuf.B) e10.getCause());
            }
            throw new com.google.crypto.tink.shaded.protobuf.B(e10.getMessage(), e10);
        } 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();
        InterfaceC0758y interfaceC0758y = g0Var.key_;
        if (!((AbstractC0736b) interfaceC0758y).f10478q) {
            int size = interfaceC0758y.size();
            g0Var.key_ = interfaceC0758y.q(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.AbstractC0755v
    public final Object i(int i) {
        com.google.crypto.tink.shaded.protobuf.W c0754u;
        switch (AbstractC1563h.c(i)) {
            case n4.u0.f15495q /* 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 Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                com.google.crypto.tink.shaded.protobuf.W w4 = PARSER;
                if (w4 != null) {
                    return w4;
                }
                synchronized (g0.class) {
                    try {
                        c0754u = PARSER;
                        if (c0754u == null) {
                            c0754u = new C0754u();
                            PARSER = c0754u;
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                    break;
                }
                return c0754u;
            default:
                throw new UnsupportedOperationException();
        }
    }

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

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