what-the-bank/sources/scb/yek/NTBProfileKey.java

195 lines
6.7 KiB
Java

package scb.yek;
import com.google.common.base.Ascii;
import com.google.common.primitives.SignedBytes;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.Locale;
import java.util.UUID;
import net.sf.scuba.smartcards.ISO7816;
import o.AbstractC14971gdc;
import o.Awr;
import o.C14957gcv;
import o.C14976gdh;
import o.C14977gdi;
import o.C17133uFJ;
import o.C4593bdB;
import o.TAC;
import o.dQY;
import o.gdP;
import o.gdZ;
import org.bouncycastle.pqc.jcajce.spec.McElieceCCA2KeyGenParameterSpec;
/* loaded from: classes6.dex */
public final class NTBProfileKey {
private static long a;
private static long b;
private static byte c;
private static char[] d;
private static long e;
private static final byte[] j = {85, SignedBytes.MAX_POWER_OF_TWO, 74, 69, -47, 8, 47, ISO7816.INS_WRITE_RECORD, 6, 5, 7, -8, -22, Ascii.US, -5, Ascii.DC2, -15, 19, 9};
private static final int g = 47;
public final native String ntbProfileKeyFromJNI(String str);
public static long a() {
return C14977gdi.d(new C14976gdh(1000000000L, 9999999999L), AbstractC14971gdc.e);
}
public static String d(String str) {
MessageDigest messageDigest = MessageDigest.getInstance(McElieceCCA2KeyGenParameterSpec.SHA256);
byte[] bytes = str.getBytes(gdP.a);
C14957gcv.c(bytes, "");
byte[] digest = messageDigest.digest(bytes);
C14957gcv.c(digest, "");
String str2 = "";
for (byte b2 : digest) {
String format = String.format("%02x", Arrays.copyOf(new Object[]{Byte.valueOf(b2)}, 1));
C14957gcv.c((Object) format, "");
StringBuilder sb = new StringBuilder();
sb.append(str2);
sb.append(format);
str2 = sb.toString();
}
String upperCase = str2.toUpperCase(Locale.ROOT);
C14957gcv.c((Object) upperCase, "");
return upperCase;
}
public static String c() {
String obj = UUID.randomUUID().toString();
C14957gcv.c((Object) obj, "");
return gdZ.a(obj, "-", "");
}
private static void i(char[] cArr, int i, Object[] objArr) {
C4593bdB c4593bdB = new C4593bdB();
c4593bdB.a = i;
int length = cArr.length;
long[] jArr = new long[length];
c4593bdB.e = 0;
while (c4593bdB.e < cArr.length) {
jArr[c4593bdB.e] = (cArr[c4593bdB.e] ^ (c4593bdB.e * c4593bdB.a)) ^ (b ^ (-6958928035870403642L));
c4593bdB.e++;
}
char[] cArr2 = new char[length];
c4593bdB.e = 0;
while (c4593bdB.e < cArr.length) {
cArr2[c4593bdB.e] = (char) jArr[c4593bdB.e];
c4593bdB.e++;
}
objArr[0] = new String(cArr2);
}
public static String a(long j2, String str) {
return gdZ.d(str, 10, 20, String.valueOf(j2)).toString();
}
/* loaded from: classes6.dex */
public static final class LWm {
private LWm() {
}
public /* synthetic */ LWm(byte b) {
this();
}
}
public static void f(char c2, int i, int i2, Object[] objArr) {
dQY dqy = new dQY();
long[] jArr = new long[i2];
dqy.a = 0;
while (dqy.a < i2) {
jArr[dqy.a] = (((char) (d[dqy.a + i] ^ 5772335002700124114L)) ^ (dqy.a * (5772335002700124114L ^ e))) ^ c2;
dqy.a++;
}
char[] cArr = new char[i2];
dqy.a = 0;
while (dqy.a < i2) {
cArr[dqy.a] = (char) jArr[dqy.a];
dqy.a++;
}
objArr[0] = new String(cArr);
}
static {
b();
d();
new LWm((byte) 0);
byte b2 = (byte) (47 & 1);
byte b3 = (byte) (b2 - 1);
Object[] objArr = new Object[1];
h(b2, b3, (byte) (b3 + 1), objArr);
b((String) objArr[0]);
}
private static InputStream a(InputStream inputStream, int i, int i2, byte[] bArr) throws IOException {
int length = bArr.length;
byte[] bArr2 = new byte[length];
System.arraycopy(bArr, 0, bArr2, 0, length);
TAC.c(bArr2, c, a);
return new C17133uFJ(inputStream, i2, bArr2, Awr.e(i));
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r6v2, types: [int] */
/* JADX WARN: Type inference failed for: r7v10, types: [int] */
/* JADX WARN: Type inference failed for: r7v7, types: [int] */
private static void h(int i, short s, byte b2, Object[] objArr) {
byte[] bArr = j;
int i2 = i * 5;
?? r6 = (s * 4) + 98;
int i3 = 9 - (b2 * 5);
byte[] bArr2 = new byte[11 - i2];
int i4 = 10 - i2;
int i5 = -1;
byte b3 = r6;
if (bArr == null) {
int i6 = i3 + r6;
int i7 = i3 + 1;
?? r7 = i6 - 2;
i5 = -1;
i3 = i7;
b3 = r7;
}
while (true) {
int i8 = i5 + 1;
bArr2[i8] = b3;
if (i8 == i4) {
objArr[0] = new String(bArr2, 0);
return;
}
i5 = i8;
i3++;
b3 = (b3 + bArr[i3]) - 2;
}
}
static void b() {
d = new char[]{36743, 53218, 3932, 20179, 36474, 41436, 57843, 8538, 24747, 40962, 57384, 9167, 25390, 41639, 57878, 8756, 26076, 42284, 58506, 9381, 25692, 42960, 59189, 9941, 26351, 42571, 59816, 10501, 26986, 15793, 32222, 48485, 64662, 15461, 31814, 49132, 65353, 16015, 32306, 48707, 63987, 14594, 30909, 36789, 53203, 3950, 20140, 36407, 52808, 3582, 19719, 35999, 52275, 7955, 24442, 40900, 56871, 7846, 24293, 40259, 56742, 7207, 23732, 40177, 36785, 53209, 3956, 20106, 36387, 52815, 3556, 19741, 36792, 53207, 3944, 20164, 36388, 52815, 3558, 19723, 36040, 36796, 53207, 3950, 20119, 36404, 52803, 3526, 19713, 35987, 52274, 36789, 53203, 3950, 20152, 36358};
e = -2941144357133889610L;
b = 2198669865143223307L;
}
static void d() {
a = -5460580109075031448L;
c = ISO7816.INS_PUT_DATA;
}
/* JADX WARN: Removed duplicated region for block: B:135:0x0586 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:44:0x037c A[EXC_TOP_SPLITTER, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static void b(java.lang.String r18) {
/*
Method dump skipped, instructions count: 1740
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: scb.yek.NTBProfileKey.b(java.lang.String):void");
}
}