package com.facetec.sdk; import com.google.common.base.Ascii; import com.google.common.primitives.UnsignedBytes; /* loaded from: classes.dex */ public final class ge { private static byte[] j = new byte[256]; static final byte[] b = new byte[256]; static final int[] c = new int[256]; static final int[] e = new int[256]; static final int[] a = new int[256]; static final int[] d = new int[256]; private static int[] h = new int[10]; private static int b(byte b2, int i) { int i2 = b2 & 255; return (i2 << i) | (i2 >> (8 - i)); } public static byte[][] d(int i) { byte[][] bArr = new byte[4]; for (int i2 = 0; i2 < 4; i2++) { int i3 = i >>> (i2 << 3); byte[] bArr2 = new byte[4]; bArr2[0] = (byte) (i3 & 3); bArr2[1] = (byte) ((i3 >> 2) & 3); bArr2[2] = (byte) ((i3 >> 4) & 3); bArr2[3] = (byte) ((i3 >> 6) & 3); bArr[i2] = bArr2; } return bArr; } /* JADX INFO: Access modifiers changed from: package-private */ public static int[] e(byte[] bArr, int i) throws IllegalArgumentException { int i2; if (bArr.length != 16) { throw new IllegalArgumentException(); } int i3 = (i + 1) << 2; int[] iArr = new int[i3]; int i4 = 0; int i5 = 0; while (i5 < 4) { iArr[i5] = (bArr[i4 + 3] & UnsignedBytes.MAX_VALUE) | (bArr[i4] << Ascii.CAN) | ((bArr[i4 + 1] & UnsignedBytes.MAX_VALUE) << 16) | ((bArr[i4 + 2] & UnsignedBytes.MAX_VALUE) << 8); i5++; i4 += 4; } int i6 = 0; int i7 = 0; int i8 = 4; while (true) { i2 = 1; if (i8 >= i3) { break; } int i9 = iArr[i8 - 1]; if (i6 == 0) { byte[] bArr2 = j; byte b2 = bArr2[(i9 >>> 16) & 255]; byte b3 = bArr2[(i9 >>> 8) & 255]; byte b4 = bArr2[i9 & 255]; i9 = ((bArr2[i9 >>> 24] & UnsignedBytes.MAX_VALUE) | (((b4 & UnsignedBytes.MAX_VALUE) << 8) | ((b2 << Ascii.CAN) | ((b3 & UnsignedBytes.MAX_VALUE) << 16)))) ^ h[i7]; i7++; i6 = 4; } iArr[i8] = iArr[i8 - 4] ^ i9; i8++; i6--; } if (bArr.length != 16) { throw new IllegalArgumentException(); } int[] iArr2 = new int[i3]; int i10 = i << 2; iArr2[0] = iArr[i10]; iArr2[1] = iArr[i10 + 1]; iArr2[2] = iArr[i10 + 2]; iArr2[3] = iArr[i10 + 3]; int i11 = i10 - 4; int i12 = 4; while (i2 < i) { int i13 = iArr[i11]; int[] iArr3 = c; byte[] bArr3 = j; int i14 = iArr3[bArr3[i13 >>> 24] & UnsignedBytes.MAX_VALUE]; int[] iArr4 = e; int i15 = iArr4[bArr3[(i13 >>> 16) & 255] & UnsignedBytes.MAX_VALUE]; int[] iArr5 = a; int i16 = iArr5[bArr3[(i13 >>> 8) & 255] & UnsignedBytes.MAX_VALUE]; int[] iArr6 = d; iArr2[i12] = iArr6[bArr3[i13 & 255] & UnsignedBytes.MAX_VALUE] ^ ((i14 ^ i15) ^ i16); int i17 = iArr[i11 + 1]; iArr2[i12 + 1] = iArr6[bArr3[i17 & 255] & UnsignedBytes.MAX_VALUE] ^ ((iArr3[bArr3[i17 >>> 24] & UnsignedBytes.MAX_VALUE] ^ iArr4[bArr3[(i17 >>> 16) & 255] & UnsignedBytes.MAX_VALUE]) ^ iArr5[bArr3[(i17 >>> 8) & 255] & UnsignedBytes.MAX_VALUE]); int i18 = iArr[i11 + 2]; iArr2[i12 + 2] = iArr6[bArr3[i18 & 255] & UnsignedBytes.MAX_VALUE] ^ ((iArr3[bArr3[i18 >>> 24] & UnsignedBytes.MAX_VALUE] ^ iArr4[bArr3[(i18 >>> 16) & 255] & UnsignedBytes.MAX_VALUE]) ^ iArr5[bArr3[(i18 >>> 8) & 255] & UnsignedBytes.MAX_VALUE]); int i19 = iArr[i11 + 3]; iArr2[i12 + 3] = iArr6[bArr3[i19 & 255] & UnsignedBytes.MAX_VALUE] ^ ((iArr3[bArr3[i19 >>> 24] & UnsignedBytes.MAX_VALUE] ^ iArr4[bArr3[(i19 >>> 16) & 255] & UnsignedBytes.MAX_VALUE]) ^ iArr5[bArr3[(i19 >>> 8) & 255] & UnsignedBytes.MAX_VALUE]); i11 -= 4; i2++; i12 += 4; } iArr2[i12] = iArr[i11]; iArr2[i12 + 1] = iArr[i11 + 1]; iArr2[i12 + 2] = iArr[i11 + 2]; iArr2[i12 + 3] = iArr[i11 + 3]; return iArr2; } static { int i; byte b2 = 1; byte b3 = 1; do { b2 = (byte) ((b2 ^ (b2 << 1)) ^ ((b2 & 128) != 0 ? 27 : 0)); byte b4 = (byte) (b3 ^ (b3 << 1)); byte b5 = (byte) (b4 ^ (b4 << 2)); byte b6 = (byte) (b5 ^ (b5 << 4)); b3 = (byte) (b6 ^ ((b6 & 128) != 0 ? (byte) 9 : (byte) 0)); byte[] bArr = j; i = b2 & UnsignedBytes.MAX_VALUE; bArr[i] = (byte) (((((b3 ^ 99) ^ b(b3, 1)) ^ b(b3, 2)) ^ b(b3, 3)) ^ b(b3, 4)); } while (i != 1); j[0] = 99; for (int i2 = 0; i2 < 256; i2++) { int i3 = j[i2] & UnsignedBytes.MAX_VALUE; b[i3] = (byte) i2; int i4 = i2 << 1; if (i4 >= 256) { i4 ^= 283; } int i5 = i4 << 1; if (i5 >= 256) { i5 ^= 283; } int i6 = i5 << 1; if (i6 >= 256) { i6 ^= 283; } int i7 = i6 ^ i2; int i8 = (i4 ^ i7) | ((i5 ^ i7) << 8) | (((i6 ^ i5) ^ i4) << 24) | (i7 << 16); c[i3] = i8; e[i3] = (i8 >>> 8) | (i8 << 24); a[i3] = (i8 >>> 16) | (i8 << 16); d[i3] = (i8 >>> 24) | (i8 << 8); } h[0] = 16777216; int i9 = 1; for (int i10 = 1; i10 < 10; i10++) { i9 <<= 1; if (i9 >= 256) { i9 ^= 283; } h[i10] = i9 << 24; } } }