369 lines
17 KiB
Java
369 lines
17 KiB
Java
package org.bouncycastle.asn1.cryptopro;
|
|
|
|
import android.graphics.PointF;
|
|
import android.os.Process;
|
|
import android.telephony.cdma.CdmaCellLocation;
|
|
import android.text.TextUtils;
|
|
import android.util.TypedValue;
|
|
import android.view.Gravity;
|
|
import android.view.KeyEvent;
|
|
import android.view.View;
|
|
import android.view.ViewConfiguration;
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
import java.lang.reflect.Method;
|
|
import java.math.BigInteger;
|
|
import java.util.Enumeration;
|
|
import java.util.Hashtable;
|
|
import net.sf.scuba.smartcards.ISO7816;
|
|
import net.sf.scuba.smartcards.ISOFileInfo;
|
|
import o.TVH;
|
|
import o.xzZ;
|
|
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
|
|
import org.bouncycastle.crypto.params.ECDomainParameters;
|
|
import org.bouncycastle.crypto.tls.CipherSuite;
|
|
import org.bouncycastle.math.ec.ECConstants;
|
|
import org.bouncycastle.math.ec.ECCurve;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public class ECGOST3410NamedCurves {
|
|
private static final byte[] $$a = {65, 0, ISO7816.INS_CHANGE_CHV, ISOFileInfo.FMD_BYTE};
|
|
private static final int $$b = CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384;
|
|
private static int $10 = 0;
|
|
private static int $11 = 1;
|
|
private static int a = 1;
|
|
private static int b;
|
|
private static char[] e;
|
|
static final Hashtable names;
|
|
static final Hashtable objIds;
|
|
static final Hashtable params;
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:10:0x0026 */
|
|
/* JADX WARN: Removed duplicated region for block: B:7:0x001e */
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0026 -> B:4:0x002e). Please report as a decompilation issue!!! */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private static void f(byte r6, short r7, byte r8, java.lang.Object[] r9) {
|
|
/*
|
|
byte[] r0 = org.bouncycastle.asn1.cryptopro.ECGOST3410NamedCurves.$$a
|
|
int r6 = r6 * 2
|
|
int r6 = 73 - r6
|
|
int r7 = r7 + 4
|
|
int r8 = r8 * 3
|
|
int r1 = 1 - r8
|
|
byte[] r1 = new byte[r1]
|
|
r2 = 0
|
|
int r8 = 0 - r8
|
|
if (r0 != 0) goto L16
|
|
r3 = r7
|
|
r4 = r2
|
|
goto L2e
|
|
L16:
|
|
r3 = r2
|
|
L17:
|
|
byte r4 = (byte) r6
|
|
int r7 = r7 + 1
|
|
r1[r3] = r4
|
|
if (r3 != r8) goto L26
|
|
java.lang.String r6 = new java.lang.String
|
|
r6.<init>(r1, r2)
|
|
r9[r2] = r6
|
|
return
|
|
L26:
|
|
int r3 = r3 + 1
|
|
r4 = r0[r7]
|
|
r5 = r3
|
|
r3 = r7
|
|
r7 = r4
|
|
r4 = r5
|
|
L2e:
|
|
int r6 = r6 + r7
|
|
r7 = r3
|
|
r3 = r4
|
|
goto L17
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.asn1.cryptopro.ECGOST3410NamedCurves.f(byte, short, byte, java.lang.Object[]):void");
|
|
}
|
|
|
|
private static void d(byte[] bArr, int[] iArr, boolean z, Object[] objArr) {
|
|
int i;
|
|
int length;
|
|
char[] cArr;
|
|
char[] cArr2;
|
|
int i2 = 2 % 2;
|
|
TVH tvh = new TVH();
|
|
int i3 = 0;
|
|
int i4 = iArr[0];
|
|
int i5 = iArr[1];
|
|
int i6 = iArr[2];
|
|
int i7 = iArr[3];
|
|
char[] cArr3 = e;
|
|
float f = BitmapDescriptorFactory.HUE_RED;
|
|
if (cArr3 != null) {
|
|
int i8 = $11 + 75;
|
|
$10 = i8 % 128;
|
|
if (i8 % 2 != 0) {
|
|
length = cArr3.length;
|
|
cArr = new char[length];
|
|
} else {
|
|
length = cArr3.length;
|
|
cArr = new char[length];
|
|
}
|
|
int i9 = 0;
|
|
while (i9 < length) {
|
|
try {
|
|
Object[] objArr2 = new Object[1];
|
|
objArr2[i3] = Integer.valueOf(cArr3[i9]);
|
|
Object obj = xzZ.y.get(1645349359);
|
|
if (obj != null) {
|
|
cArr2 = cArr3;
|
|
} else {
|
|
Class cls = (Class) xzZ.c(223 - (PointF.length(f, f) > f ? 1 : (PointF.length(f, f) == f ? 0 : -1)), 5 - (CdmaCellLocation.convertQuartSecToDecDegrees(i3) > 0.0d ? 1 : (CdmaCellLocation.convertQuartSecToDecDegrees(i3) == 0.0d ? 0 : -1)), (char) (TextUtils.getCapsMode("", i3, i3) + 41977));
|
|
byte b2 = (byte) ($$b & 5);
|
|
cArr2 = cArr3;
|
|
Object[] objArr3 = new Object[1];
|
|
f(b2, (byte) (-b2), $$a[1], objArr3);
|
|
obj = cls.getMethod((String) objArr3[0], Integer.TYPE);
|
|
xzZ.y.put(1645349359, obj);
|
|
}
|
|
cArr[i9] = ((Character) ((Method) obj).invoke(null, objArr2)).charValue();
|
|
i9++;
|
|
cArr3 = cArr2;
|
|
i3 = 0;
|
|
f = BitmapDescriptorFactory.HUE_RED;
|
|
} catch (Throwable th) {
|
|
Throwable cause = th.getCause();
|
|
if (cause == null) {
|
|
throw th;
|
|
}
|
|
throw cause;
|
|
}
|
|
}
|
|
cArr3 = cArr;
|
|
}
|
|
char[] cArr4 = new char[i5];
|
|
System.arraycopy(cArr3, i4, cArr4, 0, i5);
|
|
if (bArr != null) {
|
|
char[] cArr5 = new char[i5];
|
|
tvh.c = 0;
|
|
char c = 0;
|
|
while (tvh.c < i5) {
|
|
if (bArr[tvh.c] == 1) {
|
|
int i10 = tvh.c;
|
|
try {
|
|
Object[] objArr4 = {Integer.valueOf(cArr4[tvh.c]), Integer.valueOf(c)};
|
|
Object obj2 = xzZ.y.get(850398076);
|
|
if (obj2 == null) {
|
|
obj2 = ((Class) xzZ.c(502 - View.MeasureSpec.getSize(0), 5 - (KeyEvent.getMaxKeyCode() >> 16), (char) ((TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 54))).getMethod("F", Integer.TYPE, Integer.TYPE);
|
|
xzZ.y.put(850398076, obj2);
|
|
}
|
|
cArr5[i10] = ((Character) ((Method) obj2).invoke(null, objArr4)).charValue();
|
|
} catch (Throwable th2) {
|
|
Throwable cause2 = th2.getCause();
|
|
if (cause2 == null) {
|
|
throw th2;
|
|
}
|
|
throw cause2;
|
|
}
|
|
} else {
|
|
int i11 = tvh.c;
|
|
Object[] objArr5 = {Integer.valueOf(cArr4[tvh.c]), Integer.valueOf(c)};
|
|
Object obj3 = xzZ.y.get(1084521042);
|
|
if (obj3 == null) {
|
|
obj3 = ((Class) xzZ.c(14 - TextUtils.lastIndexOf("", '0', 0), 5 - Gravity.getAbsoluteGravity(0, 0), (char) (58134 - (KeyEvent.getMaxKeyCode() >> 16)))).getMethod("H", Integer.TYPE, Integer.TYPE);
|
|
xzZ.y.put(1084521042, obj3);
|
|
}
|
|
cArr5[i11] = ((Character) ((Method) obj3).invoke(null, objArr5)).charValue();
|
|
}
|
|
c = cArr5[tvh.c];
|
|
Object[] objArr6 = {tvh, tvh};
|
|
Object obj4 = xzZ.y.get(1698744941);
|
|
if (obj4 == null) {
|
|
Class cls2 = (Class) xzZ.c(402 - View.getDefaultSize(0, 0), (ViewConfiguration.getKeyRepeatDelay() >> 16) + 5, (char) ((Process.getElapsedCpuTime() > 0L ? 1 : (Process.getElapsedCpuTime() == 0L ? 0 : -1)) + 21607));
|
|
byte b3 = $$a[1];
|
|
byte b4 = b3;
|
|
Object[] objArr7 = new Object[1];
|
|
f(b4, (byte) (b4 - 1), b3, objArr7);
|
|
obj4 = cls2.getMethod((String) objArr7[0], Object.class, Object.class);
|
|
xzZ.y.put(1698744941, obj4);
|
|
}
|
|
((Method) obj4).invoke(null, objArr6);
|
|
int i12 = $10 + 103;
|
|
$11 = i12 % 128;
|
|
int i13 = i12 % 2;
|
|
}
|
|
cArr4 = cArr5;
|
|
}
|
|
if (i7 > 0) {
|
|
char[] cArr6 = new char[i5];
|
|
i = 0;
|
|
System.arraycopy(cArr4, 0, cArr6, 0, i5);
|
|
int i14 = i5 - i7;
|
|
System.arraycopy(cArr6, 0, cArr4, i14, i7);
|
|
System.arraycopy(cArr6, i7, cArr4, 0, i14);
|
|
} else {
|
|
i = 0;
|
|
}
|
|
if (z) {
|
|
char[] cArr7 = new char[i5];
|
|
while (true) {
|
|
tvh.c = i;
|
|
if (tvh.c >= i5) {
|
|
break;
|
|
}
|
|
cArr7[tvh.c] = cArr4[(i5 - tvh.c) - 1];
|
|
i = tvh.c + 1;
|
|
}
|
|
int i15 = $11 + 115;
|
|
$10 = i15 % 128;
|
|
int i16 = i15 % 2;
|
|
cArr4 = cArr7;
|
|
}
|
|
if (i6 > 0) {
|
|
tvh.c = 0;
|
|
while (tvh.c < i5) {
|
|
cArr4[tvh.c] = (char) (cArr4[tvh.c] - iArr[2]);
|
|
tvh.c++;
|
|
int i17 = $11 + 9;
|
|
$10 = i17 % 128;
|
|
int i18 = i17 % 2;
|
|
}
|
|
}
|
|
objArr[0] = new String(cArr4);
|
|
}
|
|
|
|
static void e() {
|
|
e = new char[]{39955, 40031};
|
|
}
|
|
|
|
public static ASN1ObjectIdentifier getOID(String str) {
|
|
int i = 2 % 2;
|
|
int i2 = a + 27;
|
|
b = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
ASN1ObjectIdentifier aSN1ObjectIdentifier = (ASN1ObjectIdentifier) objIds.get(str);
|
|
int i4 = a + 75;
|
|
b = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
return aSN1ObjectIdentifier;
|
|
}
|
|
|
|
public static Enumeration getNames() {
|
|
int i = 2 % 2;
|
|
int i2 = a + 115;
|
|
b = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
Enumeration elements = names.elements();
|
|
int i4 = b + 103;
|
|
a = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
return elements;
|
|
}
|
|
|
|
public static String getName(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
|
|
int i = 2 % 2;
|
|
int i2 = b + 51;
|
|
a = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
Object obj = names.get(aSN1ObjectIdentifier);
|
|
if (i3 != 0) {
|
|
return (String) obj;
|
|
}
|
|
int i4 = 8 / 0;
|
|
return (String) obj;
|
|
}
|
|
|
|
public static ECDomainParameters getByOID(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
|
|
int i = 2 % 2;
|
|
int i2 = b + 91;
|
|
a = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
ECDomainParameters eCDomainParameters = (ECDomainParameters) params.get(aSN1ObjectIdentifier);
|
|
if (i3 != 0) {
|
|
return eCDomainParameters;
|
|
}
|
|
Object obj = null;
|
|
obj.hashCode();
|
|
throw null;
|
|
}
|
|
|
|
public static ECDomainParameters getByName(String str) {
|
|
int i = 2 % 2;
|
|
int i2 = a + 21;
|
|
b = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
ASN1ObjectIdentifier aSN1ObjectIdentifier = (ASN1ObjectIdentifier) objIds.get(str);
|
|
if (aSN1ObjectIdentifier == null) {
|
|
return null;
|
|
}
|
|
int i4 = a + 71;
|
|
b = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
ECDomainParameters eCDomainParameters = (ECDomainParameters) params.get(aSN1ObjectIdentifier);
|
|
if (i5 == 0) {
|
|
return eCDomainParameters;
|
|
}
|
|
throw null;
|
|
}
|
|
|
|
static {
|
|
b = 0;
|
|
e();
|
|
Hashtable hashtable = new Hashtable();
|
|
objIds = hashtable;
|
|
Hashtable hashtable2 = new Hashtable();
|
|
params = hashtable2;
|
|
Hashtable hashtable3 = new Hashtable();
|
|
names = hashtable3;
|
|
BigInteger bigInteger = new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639319");
|
|
BigInteger bigInteger2 = new BigInteger("115792089237316195423570985008687907853073762908499243225378155805079068850323");
|
|
ECCurve.Fp fp = new ECCurve.Fp(bigInteger, new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639316"), new BigInteger("166"), bigInteger2, ECConstants.ONE);
|
|
Object[] objArr = new Object[1];
|
|
d(new byte[]{1}, new int[]{0, 1, 0, 1}, false, objArr);
|
|
hashtable2.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_A, new ECDomainParameters(fp, fp.createPoint(new BigInteger(((String) objArr[0]).intern()), new BigInteger("64033881142927202683649881450433473985931760268884941288852745803908878638612")), bigInteger2));
|
|
BigInteger bigInteger3 = new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639319");
|
|
BigInteger bigInteger4 = new BigInteger("115792089237316195423570985008687907853073762908499243225378155805079068850323");
|
|
ECCurve.Fp fp2 = new ECCurve.Fp(bigInteger3, new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639316"), new BigInteger("166"), bigInteger4, ECConstants.ONE);
|
|
Object[] objArr2 = new Object[1];
|
|
d(new byte[]{1}, new int[]{0, 1, 0, 1}, false, objArr2);
|
|
hashtable2.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchA, new ECDomainParameters(fp2, fp2.createPoint(new BigInteger(((String) objArr2[0]).intern()), new BigInteger("64033881142927202683649881450433473985931760268884941288852745803908878638612")), bigInteger4));
|
|
BigInteger bigInteger5 = new BigInteger("57896044618658097711785492504343953926634992332820282019728792003956564823193");
|
|
BigInteger bigInteger6 = new BigInteger("57896044618658097711785492504343953927102133160255826820068844496087732066703");
|
|
ECCurve.Fp fp3 = new ECCurve.Fp(bigInteger5, new BigInteger("57896044618658097711785492504343953926634992332820282019728792003956564823190"), new BigInteger("28091019353058090096996979000309560759124368558014865957655842872397301267595"), bigInteger6, ECConstants.ONE);
|
|
Object[] objArr3 = new Object[1];
|
|
d(new byte[]{1}, new int[]{0, 1, 0, 1}, false, objArr3);
|
|
hashtable2.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_B, new ECDomainParameters(fp3, fp3.createPoint(new BigInteger(((String) objArr3[0]).intern()), new BigInteger("28792665814854611296992347458380284135028636778229113005756334730996303888124")), bigInteger6));
|
|
BigInteger bigInteger7 = new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502619");
|
|
BigInteger bigInteger8 = new BigInteger("70390085352083305199547718019018437840920882647164081035322601458352298396601");
|
|
ECCurve.Fp fp4 = new ECCurve.Fp(bigInteger7, new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502616"), new BigInteger("32858"), bigInteger8, ECConstants.ONE);
|
|
Object[] objArr4 = new Object[1];
|
|
d(new byte[]{0}, new int[]{1, 1, 120, 1}, false, objArr4);
|
|
hashtable2.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchB, new ECDomainParameters(fp4, fp4.createPoint(new BigInteger(((String) objArr4[0]).intern()), new BigInteger("29818893917731240733471273240314769927240550812383695689146495261604565990247")), bigInteger8));
|
|
BigInteger bigInteger9 = new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502619");
|
|
BigInteger bigInteger10 = new BigInteger("70390085352083305199547718019018437840920882647164081035322601458352298396601");
|
|
ECCurve.Fp fp5 = new ECCurve.Fp(bigInteger9, new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502616"), new BigInteger("32858"), bigInteger10, ECConstants.ONE);
|
|
Object[] objArr5 = new Object[1];
|
|
d(new byte[]{0}, new int[]{1, 1, 120, 1}, false, objArr5);
|
|
hashtable2.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_C, new ECDomainParameters(fp5, fp5.createPoint(new BigInteger(((String) objArr5[0]).intern()), new BigInteger("29818893917731240733471273240314769927240550812383695689146495261604565990247")), bigInteger10));
|
|
hashtable.put("GostR3410-2001-CryptoPro-A", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_A);
|
|
hashtable.put("GostR3410-2001-CryptoPro-B", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_B);
|
|
hashtable.put("GostR3410-2001-CryptoPro-C", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_C);
|
|
hashtable.put("GostR3410-2001-CryptoPro-XchA", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchA);
|
|
hashtable.put("GostR3410-2001-CryptoPro-XchB", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchB);
|
|
hashtable3.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_A, "GostR3410-2001-CryptoPro-A");
|
|
hashtable3.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_B, "GostR3410-2001-CryptoPro-B");
|
|
hashtable3.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_C, "GostR3410-2001-CryptoPro-C");
|
|
hashtable3.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchA, "GostR3410-2001-CryptoPro-XchA");
|
|
hashtable3.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchB, "GostR3410-2001-CryptoPro-XchB");
|
|
int i = a + 49;
|
|
b = i % 128;
|
|
if (i % 2 == 0) {
|
|
return;
|
|
}
|
|
Object obj = null;
|
|
obj.hashCode();
|
|
throw null;
|
|
}
|
|
}
|