package J3;

import androidx.datastore.preferences.protobuf.C0429g;
import androidx.datastore.preferences.protobuf.C0446y;
import com.google.android.gms.internal.measurement.AbstractC0707u1;
import com.google.crypto.tink.shaded.protobuf.B;
import com.google.crypto.tink.shaded.protobuf.C0741g;
import com.google.crypto.tink.shaded.protobuf.C0743i;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.security.GeneralSecurityException;

/* JADX INFO: loaded from: classes.dex */
public abstract class e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f3473a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f3474b;

    public static int d(int i) {
        return (-(i & 1)) ^ (i >>> 1);
    }

    public static long e(long j8) {
        return (-(j8 & 1)) ^ (j8 >>> 1);
    }

    public static C0743i h(byte[] bArr, int i, int i5, boolean z8) {
        C0743i c0743i = new C0743i(bArr, i, i5, z8);
        try {
            c0743i.l(i5);
            return c0743i;
        } catch (B e8) {
            throw new IllegalArgumentException(e8);
        }
    }

    public abstract String A();

    public abstract String B();

    public abstract int C();

    public abstract int D();

    public abstract long E();

    public abstract boolean F(int i);

    public void G() {
        int iC;
        do {
            iC = C();
            if (iC == 0) {
                return;
            }
            int i = this.f3473a;
            if (i >= 100) {
                throw new C0446y("Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.");
            }
            this.f3473a = i + 1;
            this.f3473a--;
        } while (F(iC));
    }

    public ByteBuffer a(int i, byte[] bArr) {
        int[] iArrC = c(a.c(bArr), i);
        int[] iArr = (int[]) iArrC.clone();
        a.b(iArr);
        for (int i5 = 0; i5 < iArrC.length; i5++) {
            iArrC[i5] = iArrC[i5] + iArr[i5];
        }
        ByteBuffer byteBufferOrder = ByteBuffer.allocate(64).order(ByteOrder.LITTLE_ENDIAN);
        byteBufferOrder.asIntBuffer().put(iArrC, 0, 16);
        return byteBufferOrder;
    }

    public abstract void b(int i);

    public abstract int[] c(int[] iArr, int i);

    public abstract int f();

    public abstract boolean g();

    public abstract int i();

    public abstract void j(int i);

    public void k(byte[] bArr, ByteBuffer byteBuffer, ByteBuffer byteBuffer2) throws GeneralSecurityException {
        if (bArr.length != i()) {
            throw new GeneralSecurityException("The nonce length (in bytes) must be " + i());
        }
        int iRemaining = byteBuffer2.remaining();
        int i = iRemaining / 64;
        int i5 = i + 1;
        for (int i8 = 0; i8 < i5; i8++) {
            ByteBuffer byteBufferA = a(this.f3473a + i8, bArr);
            if (i8 == i) {
                AbstractC0707u1.o(byteBuffer, byteBuffer2, byteBufferA, iRemaining % 64);
            } else {
                AbstractC0707u1.o(byteBuffer, byteBuffer2, byteBufferA, 64);
            }
        }
    }

    public abstract int l(int i);

    public abstract boolean m();

    public abstract C0429g n();

    public abstract C0741g o();

    public abstract double p();

    public abstract int q();

    public abstract int r();

    public abstract long s();

    public abstract float t();

    public abstract int u();

    public abstract long v();

    public abstract int w();

    public abstract long x();

    public abstract int y();

    public abstract long z();
}
