682 lines
27 KiB
Java
682 lines
27 KiB
Java
|
package org.bouncycastle.crypto.generators;
|
||
|
|
||
|
import android.graphics.Color;
|
||
|
import android.graphics.ImageFormat;
|
||
|
import android.graphics.PointF;
|
||
|
import android.text.TextUtils;
|
||
|
import android.view.KeyEvent;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewConfiguration;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
import java.math.BigInteger;
|
||
|
import java.security.SecureRandom;
|
||
|
import net.sf.scuba.smartcards.ISOFileInfo;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class GOST3410ParametersGenerator {
|
||
|
private static final BigInteger ONE;
|
||
|
private static final BigInteger TWO;
|
||
|
private static short[] a;
|
||
|
private static byte[] b;
|
||
|
private static int c;
|
||
|
private static int d;
|
||
|
private static int e;
|
||
|
private static int f;
|
||
|
private SecureRandom init_random;
|
||
|
private int size;
|
||
|
private int typeproc;
|
||
|
private static final byte[] $$a = {105, 77, -86, 73};
|
||
|
private static final int $$b = 106;
|
||
|
private static int $10 = 0;
|
||
|
private static int $11 = 1;
|
||
|
private static int g = 1;
|
||
|
|
||
|
/* 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:0x0028). 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 i(byte r6, int r7, int r8, java.lang.Object[] r9) {
|
||
|
/*
|
||
|
byte[] r0 = org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.$$a
|
||
|
int r6 = r6 * 4
|
||
|
int r6 = 4 - r6
|
||
|
int r7 = r7 * 2
|
||
|
int r7 = r7 + 108
|
||
|
int r8 = r8 * 3
|
||
|
int r8 = 1 - r8
|
||
|
byte[] r1 = new byte[r8]
|
||
|
r2 = 0
|
||
|
if (r0 != 0) goto L16
|
||
|
r3 = r8
|
||
|
r5 = r2
|
||
|
goto L28
|
||
|
L16:
|
||
|
r3 = r2
|
||
|
L17:
|
||
|
byte r4 = (byte) r7
|
||
|
int r5 = r3 + 1
|
||
|
r1[r3] = r4
|
||
|
if (r5 != r8) goto L26
|
||
|
java.lang.String r6 = new java.lang.String
|
||
|
r6.<init>(r1, r2)
|
||
|
r9[r2] = r6
|
||
|
return
|
||
|
L26:
|
||
|
r3 = r0[r6]
|
||
|
L28:
|
||
|
int r6 = r6 + 1
|
||
|
int r7 = r7 + r3
|
||
|
r3 = r5
|
||
|
goto L17
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.i(byte, int, int, java.lang.Object[]):void");
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Removed duplicated region for block: B:14:0x0233 */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:37:0x02fa */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private static void h(short r21, byte r22, int r23, int r24, int r25, java.lang.Object[] r26) {
|
||
|
/*
|
||
|
Method dump skipped, instructions count: 902
|
||
|
To view this dump add '--comments-level debug' option
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.h(short, byte, int, int, int, java.lang.Object[]):void");
|
||
|
}
|
||
|
|
||
|
static void c() {
|
||
|
c = -2014048987;
|
||
|
e = 1406017110;
|
||
|
d = -1917564405;
|
||
|
b = new byte[]{ISOFileInfo.AB};
|
||
|
}
|
||
|
|
||
|
public void init(int i, int i2, SecureRandom secureRandom) {
|
||
|
int i3 = 2 % 2;
|
||
|
int i4 = g + 67;
|
||
|
int i5 = i4 % 128;
|
||
|
f = i5;
|
||
|
int i6 = i4 % 2;
|
||
|
this.size = i;
|
||
|
this.typeproc = i2;
|
||
|
this.init_random = secureRandom;
|
||
|
int i7 = i5 + 97;
|
||
|
g = i7 % 128;
|
||
|
int i8 = i7 % 2;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:11:0x003f, code lost:
|
||
|
|
||
|
if (r7 != 1024) goto L13;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:12:0x0041, code lost:
|
||
|
|
||
|
procedure_B(r2, r6, r1);
|
||
|
r3 = org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.f + 105;
|
||
|
org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.g = r3 % 128;
|
||
|
r3 = r3 % 2;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:14:0x0053, code lost:
|
||
|
|
||
|
throw new java.lang.IllegalArgumentException("Ooops! key size 512 or 1024 bit.");
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:16:0x003d, code lost:
|
||
|
|
||
|
if (r7 != 512) goto L11;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:6:0x002c, code lost:
|
||
|
|
||
|
if (r7 != 16662) goto L11;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:7:0x0054, code lost:
|
||
|
|
||
|
procedure_A(r2, r6, r1, 512);
|
||
|
*/
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
public org.bouncycastle.crypto.params.GOST3410Parameters generateParameters() {
|
||
|
/*
|
||
|
r15 = this;
|
||
|
r0 = 2
|
||
|
int r1 = r0 % r0
|
||
|
java.math.BigInteger[] r1 = new java.math.BigInteger[r0]
|
||
|
int r2 = r15.typeproc
|
||
|
java.lang.String r3 = "Ooops! key size 512 or 1024 bit."
|
||
|
r4 = 1024(0x400, float:1.435E-42)
|
||
|
r9 = 0
|
||
|
r5 = 512(0x200, float:7.17E-43)
|
||
|
r10 = 1
|
||
|
if (r2 != r10) goto L6a
|
||
|
int r2 = org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.f
|
||
|
int r2 = r2 + 35
|
||
|
int r6 = r2 % 128
|
||
|
org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.g = r6
|
||
|
int r2 = r2 % r0
|
||
|
if (r2 != 0) goto L2f
|
||
|
java.security.SecureRandom r2 = r15.init_random
|
||
|
int r2 = r2.nextInt()
|
||
|
java.security.SecureRandom r6 = r15.init_random
|
||
|
int r6 = r6.nextInt()
|
||
|
int r7 = r15.size
|
||
|
r8 = 16662(0x4116, float:2.3348E-41)
|
||
|
if (r7 == r8) goto L54
|
||
|
goto L3f
|
||
|
L2f:
|
||
|
java.security.SecureRandom r2 = r15.init_random
|
||
|
int r2 = r2.nextInt()
|
||
|
java.security.SecureRandom r6 = r15.init_random
|
||
|
int r6 = r6.nextInt()
|
||
|
int r7 = r15.size
|
||
|
if (r7 == r5) goto L54
|
||
|
L3f:
|
||
|
if (r7 != r4) goto L4e
|
||
|
r15.procedure_B(r2, r6, r1)
|
||
|
int r3 = org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.f
|
||
|
int r3 = r3 + 105
|
||
|
int r4 = r3 % 128
|
||
|
org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.g = r4
|
||
|
int r3 = r3 % r0
|
||
|
goto L57
|
||
|
L4e:
|
||
|
java.lang.IllegalArgumentException r0 = new java.lang.IllegalArgumentException
|
||
|
r0.<init>(r3)
|
||
|
throw r0
|
||
|
L54:
|
||
|
r15.procedure_A(r2, r6, r1, r5)
|
||
|
L57:
|
||
|
r0 = r1[r9]
|
||
|
r1 = r1[r10]
|
||
|
org.bouncycastle.crypto.params.GOST3410Parameters r3 = new org.bouncycastle.crypto.params.GOST3410Parameters
|
||
|
java.math.BigInteger r4 = r15.procedure_C(r0, r1)
|
||
|
org.bouncycastle.crypto.params.GOST3410ValidationParameters r5 = new org.bouncycastle.crypto.params.GOST3410ValidationParameters
|
||
|
r5.<init>(r2, r6)
|
||
|
r3.<init>(r0, r1, r4, r5)
|
||
|
return r3
|
||
|
L6a:
|
||
|
java.security.SecureRandom r2 = r15.init_random
|
||
|
long r11 = r2.nextLong()
|
||
|
java.security.SecureRandom r2 = r15.init_random
|
||
|
long r13 = r2.nextLong()
|
||
|
int r2 = r15.size
|
||
|
if (r2 == r5) goto La3
|
||
|
int r5 = org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.f
|
||
|
int r5 = r5 + 35
|
||
|
int r6 = r5 % 128
|
||
|
org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.g = r6
|
||
|
int r5 = r5 % r0
|
||
|
if (r2 != r4) goto L9d
|
||
|
int r6 = r6 + 5
|
||
|
int r2 = r6 % 128
|
||
|
org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.f = r2
|
||
|
int r6 = r6 % r0
|
||
|
r2 = r15
|
||
|
r3 = r11
|
||
|
if (r6 != 0) goto L96
|
||
|
r5 = r13
|
||
|
r7 = r1
|
||
|
r2.procedure_Bb(r3, r5, r7)
|
||
|
goto Lac
|
||
|
L96:
|
||
|
r5 = r13
|
||
|
r7 = r1
|
||
|
r2.procedure_Bb(r3, r5, r7)
|
||
|
r0 = 0
|
||
|
throw r0
|
||
|
L9d:
|
||
|
java.lang.IllegalStateException r0 = new java.lang.IllegalStateException
|
||
|
r0.<init>(r3)
|
||
|
throw r0
|
||
|
La3:
|
||
|
r8 = 512(0x200, float:7.17E-43)
|
||
|
r2 = r15
|
||
|
r3 = r11
|
||
|
r5 = r13
|
||
|
r7 = r1
|
||
|
r2.procedure_Aa(r3, r5, r7, r8)
|
||
|
Lac:
|
||
|
r0 = r1[r9]
|
||
|
r1 = r1[r10]
|
||
|
org.bouncycastle.crypto.params.GOST3410Parameters r2 = new org.bouncycastle.crypto.params.GOST3410Parameters
|
||
|
java.math.BigInteger r3 = r15.procedure_C(r0, r1)
|
||
|
org.bouncycastle.crypto.params.GOST3410ValidationParameters r4 = new org.bouncycastle.crypto.params.GOST3410ValidationParameters
|
||
|
r4.<init>(r11, r13)
|
||
|
r2.<init>(r0, r1, r3, r4)
|
||
|
return r2
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.generateParameters():org.bouncycastle.crypto.params.GOST3410Parameters");
|
||
|
}
|
||
|
|
||
|
private BigInteger procedure_C(BigInteger bigInteger, BigInteger bigInteger2) {
|
||
|
BigInteger modPow;
|
||
|
int i = 2 % 2;
|
||
|
int i2 = f + 31;
|
||
|
g = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
BigInteger subtract = bigInteger.subtract(ONE);
|
||
|
BigInteger divide = subtract.divide(bigInteger2);
|
||
|
int bitLength = bigInteger.bitLength();
|
||
|
while (true) {
|
||
|
BigInteger bigInteger3 = new BigInteger(bitLength, this.init_random);
|
||
|
BigInteger bigInteger4 = ONE;
|
||
|
if (bigInteger3.compareTo(bigInteger4) > 0 && bigInteger3.compareTo(subtract) < 0) {
|
||
|
int i4 = f + 123;
|
||
|
g = i4 % 128;
|
||
|
int i5 = i4 % 2;
|
||
|
modPow = bigInteger3.modPow(divide, bigInteger);
|
||
|
if (modPow.compareTo(bigInteger4) != 0) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
int i6 = f + 107;
|
||
|
g = i6 % 128;
|
||
|
if (i6 % 2 == 0) {
|
||
|
int i7 = 83 / 0;
|
||
|
}
|
||
|
return modPow;
|
||
|
}
|
||
|
|
||
|
private void procedure_Bb(long j, long j2, BigInteger[] bigIntegerArr) {
|
||
|
int i = 2;
|
||
|
int i2 = 2 % 2;
|
||
|
long j3 = j;
|
||
|
while (true) {
|
||
|
if (j3 >= 0 && j3 <= 4294967296L) {
|
||
|
break;
|
||
|
} else {
|
||
|
j3 = this.init_random.nextInt() << 1;
|
||
|
}
|
||
|
}
|
||
|
long j4 = j2;
|
||
|
while (true) {
|
||
|
if (j4 >= 0 && j4 <= 4294967296L && j4 / 2 != 0) {
|
||
|
break;
|
||
|
} else {
|
||
|
j4 = (this.init_random.nextInt() << 1) + 1;
|
||
|
}
|
||
|
}
|
||
|
BigInteger[] bigIntegerArr2 = new BigInteger[2];
|
||
|
BigInteger bigInteger = new BigInteger(Long.toString(j4));
|
||
|
BigInteger bigInteger2 = new BigInteger("97781173");
|
||
|
long j5 = j4;
|
||
|
long procedure_Aa = procedure_Aa(j3, j5, bigIntegerArr2, 256);
|
||
|
int i3 = 0;
|
||
|
BigInteger bigInteger3 = bigIntegerArr2[0];
|
||
|
long procedure_Aa2 = procedure_Aa(procedure_Aa, j5, bigIntegerArr2, 512);
|
||
|
BigInteger bigInteger4 = bigIntegerArr2[0];
|
||
|
BigInteger[] bigIntegerArr3 = new BigInteger[33];
|
||
|
bigIntegerArr3[0] = new BigInteger(Long.toString(procedure_Aa2));
|
||
|
while (true) {
|
||
|
int i4 = i3;
|
||
|
while (i4 < 32) {
|
||
|
int i5 = i4 + 1;
|
||
|
bigIntegerArr3[i5] = bigIntegerArr3[i4].multiply(bigInteger2).add(bigInteger).mod(TWO.pow(32));
|
||
|
i4 = i5;
|
||
|
}
|
||
|
Object[] objArr = new Object[1];
|
||
|
h((short) ((-1) - TextUtils.indexOf((CharSequence) "", '0')), (byte) (KeyEvent.keyCodeFromString("") + 76), View.MeasureSpec.getSize(i3) - 68, 734391504 - (ViewConfiguration.getMaximumFlingVelocity() >> 16), 562408466 - View.MeasureSpec.getSize(i3), objArr);
|
||
|
BigInteger bigInteger5 = new BigInteger(((String) objArr[i3]).intern());
|
||
|
for (int i6 = i3; i6 < 32; i6++) {
|
||
|
bigInteger5 = bigInteger5.add(bigIntegerArr3[i6].multiply(TWO.pow(i6 << 5)));
|
||
|
}
|
||
|
bigIntegerArr3[i3] = bigIntegerArr3[32];
|
||
|
BigInteger bigInteger6 = TWO;
|
||
|
int i7 = 1024;
|
||
|
BigInteger add = bigInteger6.pow(1023).divide(bigInteger3.multiply(bigInteger4)).add(bigInteger6.pow(1023).multiply(bigInteger5).divide(bigInteger3.multiply(bigInteger4).multiply(bigInteger6.pow(1024))));
|
||
|
BigInteger mod = add.mod(bigInteger6);
|
||
|
BigInteger bigInteger7 = ONE;
|
||
|
if (mod.compareTo(bigInteger7) == 0) {
|
||
|
int i8 = f + 31;
|
||
|
g = i8 % 128;
|
||
|
int i9 = i8 % i;
|
||
|
add = add.add(bigInteger7);
|
||
|
}
|
||
|
int i10 = i3;
|
||
|
while (true) {
|
||
|
long j6 = i10;
|
||
|
BigInteger multiply = bigInteger3.multiply(bigInteger4).multiply(add.add(BigInteger.valueOf(j6)));
|
||
|
BigInteger bigInteger8 = ONE;
|
||
|
BigInteger add2 = multiply.add(bigInteger8);
|
||
|
BigInteger bigInteger9 = TWO;
|
||
|
if (add2.compareTo(bigInteger9.pow(i7)) != 1) {
|
||
|
if (bigInteger9.modPow(bigInteger3.multiply(bigInteger4).multiply(add.add(BigInteger.valueOf(j6))), add2).compareTo(bigInteger8) == 0) {
|
||
|
int i11 = f + 27;
|
||
|
g = i11 % 128;
|
||
|
int i12 = i11 % 2;
|
||
|
if (bigInteger9.modPow(bigInteger3.multiply(add.add(BigInteger.valueOf(j6))), add2).compareTo(bigInteger8) != 0) {
|
||
|
int i13 = f + 39;
|
||
|
g = i13 % 128;
|
||
|
int i14 = i13 % 2;
|
||
|
bigIntegerArr[0] = add2;
|
||
|
bigIntegerArr[1] = bigInteger3;
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
i10 += 2;
|
||
|
i7 = 1024;
|
||
|
}
|
||
|
}
|
||
|
i = 2;
|
||
|
i3 = 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void procedure_B(int i, int i2, BigInteger[] bigIntegerArr) {
|
||
|
int i3 = 2;
|
||
|
int i4 = 2 % 2;
|
||
|
int i5 = i;
|
||
|
while (true) {
|
||
|
if (i5 >= 0 && i5 <= 65536) {
|
||
|
break;
|
||
|
}
|
||
|
i5 = this.init_random.nextInt() / 32768;
|
||
|
i3 = i3;
|
||
|
}
|
||
|
int i6 = i2;
|
||
|
while (true) {
|
||
|
if (i6 >= 0) {
|
||
|
int i7 = g + 45;
|
||
|
f = i7 % 128;
|
||
|
int i8 = i7 % i3;
|
||
|
if (i6 <= 65536 && i6 / 2 != 0) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
i6 = (this.init_random.nextInt() / 32768) + 1;
|
||
|
i3 = i3;
|
||
|
}
|
||
|
BigInteger[] bigIntegerArr2 = new BigInteger[i3];
|
||
|
BigInteger bigInteger = new BigInteger(Integer.toString(i6));
|
||
|
BigInteger bigInteger2 = new BigInteger("19381");
|
||
|
int procedure_A = procedure_A(i5, i6, bigIntegerArr2, 256);
|
||
|
int i9 = 0;
|
||
|
BigInteger bigInteger3 = bigIntegerArr2[0];
|
||
|
int procedure_A2 = procedure_A(procedure_A, i6, bigIntegerArr2, 512);
|
||
|
BigInteger bigInteger4 = bigIntegerArr2[0];
|
||
|
BigInteger[] bigIntegerArr3 = new BigInteger[65];
|
||
|
bigIntegerArr3[0] = new BigInteger(Integer.toString(procedure_A2));
|
||
|
while (true) {
|
||
|
int i10 = i9;
|
||
|
while (i10 < 64) {
|
||
|
int i11 = f + 25;
|
||
|
g = i11 % 128;
|
||
|
int i12 = i11 % i3;
|
||
|
int i13 = i10 + 1;
|
||
|
bigIntegerArr3[i13] = bigIntegerArr3[i10].multiply(bigInteger2).add(bigInteger).mod(TWO.pow(16));
|
||
|
i10 = i13;
|
||
|
}
|
||
|
Object[] objArr = new Object[1];
|
||
|
h((short) (ImageFormat.getBitsPerPixel(i9) + 1), (byte) (76 - (KeyEvent.getMaxKeyCode() >> 16)), TextUtils.indexOf((CharSequence) "", '0', i9) - 67, TextUtils.lastIndexOf("", '0', i9, i9) + 734391505, (PointF.length(BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) > BitmapDescriptorFactory.HUE_RED ? 1 : (PointF.length(BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 562408466, objArr);
|
||
|
BigInteger bigInteger5 = new BigInteger(((String) objArr[i9]).intern());
|
||
|
for (int i14 = i9; i14 < 64; i14++) {
|
||
|
bigInteger5 = bigInteger5.add(bigIntegerArr3[i14].multiply(TWO.pow(i14 << 4)));
|
||
|
}
|
||
|
bigIntegerArr3[i9] = bigIntegerArr3[64];
|
||
|
BigInteger bigInteger6 = TWO;
|
||
|
int i15 = 1024;
|
||
|
BigInteger add = bigInteger6.pow(1023).divide(bigInteger3.multiply(bigInteger4)).add(bigInteger6.pow(1023).multiply(bigInteger5).divide(bigInteger3.multiply(bigInteger4).multiply(bigInteger6.pow(1024))));
|
||
|
BigInteger mod = add.mod(bigInteger6);
|
||
|
BigInteger bigInteger7 = ONE;
|
||
|
if (mod.compareTo(bigInteger7) == 0) {
|
||
|
add = add.add(bigInteger7);
|
||
|
}
|
||
|
int i16 = i9;
|
||
|
while (true) {
|
||
|
long j = i16;
|
||
|
BigInteger multiply = bigInteger3.multiply(bigInteger4).multiply(add.add(BigInteger.valueOf(j)));
|
||
|
BigInteger bigInteger8 = ONE;
|
||
|
BigInteger add2 = multiply.add(bigInteger8);
|
||
|
BigInteger bigInteger9 = TWO;
|
||
|
if (add2.compareTo(bigInteger9.pow(i15)) != 1) {
|
||
|
int i17 = g + 85;
|
||
|
f = i17 % 128;
|
||
|
int i18 = i17 % 2;
|
||
|
if (bigInteger9.modPow(bigInteger3.multiply(bigInteger4).multiply(add.add(BigInteger.valueOf(j))), add2).compareTo(bigInteger8) == 0) {
|
||
|
int i19 = g + 43;
|
||
|
f = i19 % 128;
|
||
|
int i20 = i19 % 2;
|
||
|
if (bigInteger9.modPow(bigInteger3.multiply(add.add(BigInteger.valueOf(j))), add2).compareTo(bigInteger8) != 0) {
|
||
|
bigIntegerArr[0] = add2;
|
||
|
bigIntegerArr[1] = bigInteger3;
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
i16 += 2;
|
||
|
int i21 = g + 107;
|
||
|
f = i21 % 128;
|
||
|
int i22 = i21 % 2;
|
||
|
i15 = 1024;
|
||
|
}
|
||
|
}
|
||
|
i3 = 2;
|
||
|
i9 = 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:52:0x0206, code lost:
|
||
|
|
||
|
r1 = org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.f + 67;
|
||
|
org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.g = r1 % 128;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:53:0x0210, code lost:
|
||
|
|
||
|
if ((r1 % 2) != 0) goto L53;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:54:0x0212, code lost:
|
||
|
|
||
|
r13 = r13 + 44;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:55:0x0214, code lost:
|
||
|
|
||
|
if (r13 < 0) goto L76;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:57:0x022a, code lost:
|
||
|
|
||
|
r30[0] = r11[0];
|
||
|
r30[1] = r11[1];
|
||
|
r1 = r2[0];
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:61:0x021b, code lost:
|
||
|
|
||
|
r14 = r14 + 1;
|
||
|
r6 = r16;
|
||
|
r9 = r10;
|
||
|
r10 = 0;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:62:0x0217, code lost:
|
||
|
|
||
|
r13 = r13 - 1;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:63:0x0219, code lost:
|
||
|
|
||
|
if (r13 < 0) goto L77;
|
||
|
*/
|
||
|
/* JADX WARN: Removed duplicated region for block: B:51:0x0206 A[EDGE_INSN: B:51:0x0206->B:52:0x0206 BREAK A[LOOP:4: B:25:0x0097->B:73:0x0243], SYNTHETIC] */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:66:0x0237 A[SYNTHETIC] */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private long procedure_Aa(long r26, long r28, java.math.BigInteger[] r30, int r31) {
|
||
|
/*
|
||
|
Method dump skipped, instructions count: 634
|
||
|
To view this dump add '--comments-level debug' option
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.crypto.generators.GOST3410ParametersGenerator.procedure_Aa(long, long, java.math.BigInteger[], int):long");
|
||
|
}
|
||
|
|
||
|
private int procedure_A(int i, int i2, BigInteger[] bigIntegerArr, int i3) {
|
||
|
int i4;
|
||
|
BigInteger bigInteger;
|
||
|
BigInteger bigInteger2;
|
||
|
BigInteger bigInteger3;
|
||
|
int i5;
|
||
|
int i6;
|
||
|
int i7 = 2;
|
||
|
int i8 = 2 % 2;
|
||
|
int i9 = i;
|
||
|
while (true) {
|
||
|
if (i9 >= 0 && i9 <= 65536) {
|
||
|
break;
|
||
|
}
|
||
|
i9 = this.init_random.nextInt() / 32768;
|
||
|
i7 = i7;
|
||
|
}
|
||
|
int i10 = i2;
|
||
|
while (true) {
|
||
|
i4 = 1;
|
||
|
if (i10 >= 0 && i10 <= 65536 && i10 / 2 != 0) {
|
||
|
break;
|
||
|
}
|
||
|
i10 = 1 + (this.init_random.nextInt() / 32768);
|
||
|
i7 = i7;
|
||
|
}
|
||
|
BigInteger bigInteger4 = new BigInteger(Integer.toString(i10));
|
||
|
BigInteger bigInteger5 = new BigInteger("19381");
|
||
|
BigInteger[] bigIntegerArr2 = {new BigInteger(Integer.toString(i9))};
|
||
|
int[] iArr = {i3};
|
||
|
int i11 = 0;
|
||
|
int i12 = 0;
|
||
|
int i13 = 0;
|
||
|
while (iArr[i12] >= 17) {
|
||
|
int length = iArr.length + 1;
|
||
|
int[] iArr2 = new int[length];
|
||
|
System.arraycopy(iArr, 0, iArr2, 0, iArr.length);
|
||
|
iArr = new int[length];
|
||
|
System.arraycopy(iArr2, 0, iArr, 0, length);
|
||
|
i13 = i12 + 1;
|
||
|
iArr[i13] = iArr[i12] / i7;
|
||
|
i12 = i13;
|
||
|
}
|
||
|
BigInteger[] bigIntegerArr3 = new BigInteger[i13 + 1];
|
||
|
int i14 = 16;
|
||
|
bigIntegerArr3[i13] = new BigInteger("8003", 16);
|
||
|
int i15 = i13 - 1;
|
||
|
int i16 = 0;
|
||
|
while (i16 < i13) {
|
||
|
int i17 = f + 83;
|
||
|
g = i17 % 128;
|
||
|
int i18 = i17 % i7;
|
||
|
int i19 = iArr[i15] / i14;
|
||
|
while (true) {
|
||
|
int length2 = bigIntegerArr2.length;
|
||
|
BigInteger[] bigIntegerArr4 = new BigInteger[length2];
|
||
|
System.arraycopy(bigIntegerArr2, i11, bigIntegerArr4, i11, bigIntegerArr2.length);
|
||
|
bigIntegerArr2 = new BigInteger[i19 + 1];
|
||
|
System.arraycopy(bigIntegerArr4, i11, bigIntegerArr2, i11, length2);
|
||
|
int i20 = i11;
|
||
|
while (i20 < i19) {
|
||
|
int i21 = i20 + 1;
|
||
|
bigIntegerArr2[i21] = bigIntegerArr2[i20].multiply(bigInteger5).add(bigInteger4).mod(TWO.pow(i14));
|
||
|
i20 = i21;
|
||
|
}
|
||
|
Object[] objArr = new Object[i4];
|
||
|
h((short) TextUtils.getTrimmedLength(""), (byte) (76 - (ViewConfiguration.getTouchSlop() >> 8)), View.MeasureSpec.getMode(i11) - 68, (ViewConfiguration.getJumpTapTimeout() >> 16) + 734391504, Color.rgb(i11, i11, i11) + 579185682, objArr);
|
||
|
BigInteger bigInteger6 = new BigInteger(((String) objArr[i11]).intern());
|
||
|
int i22 = f + 53;
|
||
|
g = i22 % 128;
|
||
|
int i23 = i22 % 2;
|
||
|
for (int i24 = i11; i24 < i19; i24++) {
|
||
|
bigInteger6 = bigInteger6.add(bigIntegerArr2[i24].multiply(TWO.pow(i24 << 4)));
|
||
|
}
|
||
|
bigIntegerArr2[i11] = bigIntegerArr2[i19];
|
||
|
BigInteger bigInteger7 = TWO;
|
||
|
int i25 = i15 + 1;
|
||
|
BigInteger add = bigInteger7.pow(iArr[i15] - 1).divide(bigIntegerArr3[i25]).add(bigInteger7.pow(iArr[i15] - 1).multiply(bigInteger6).divide(bigIntegerArr3[i25].multiply(bigInteger7.pow(i19 << 4))));
|
||
|
BigInteger mod = add.mod(bigInteger7);
|
||
|
BigInteger bigInteger8 = ONE;
|
||
|
if (mod.compareTo(bigInteger8) == 0) {
|
||
|
add = add.add(bigInteger8);
|
||
|
}
|
||
|
int i26 = 0;
|
||
|
while (true) {
|
||
|
bigInteger2 = bigInteger4;
|
||
|
bigInteger3 = bigInteger5;
|
||
|
long j = i26;
|
||
|
i5 = i13;
|
||
|
BigInteger multiply = bigIntegerArr3[i25].multiply(add.add(BigInteger.valueOf(j)));
|
||
|
BigInteger bigInteger9 = ONE;
|
||
|
BigInteger add2 = multiply.add(bigInteger9);
|
||
|
bigIntegerArr3[i15] = add2;
|
||
|
BigInteger bigInteger10 = TWO;
|
||
|
i6 = i19;
|
||
|
if (add2.compareTo(bigInteger10.pow(iArr[i15])) != 1) {
|
||
|
int i27 = g + 45;
|
||
|
f = i27 % 128;
|
||
|
int i28 = i27 % 2;
|
||
|
if (bigInteger10.modPow(bigIntegerArr3[i25].multiply(add.add(BigInteger.valueOf(j))), bigIntegerArr3[i15]).compareTo(bigInteger9) == 0 && bigInteger10.modPow(add.add(BigInteger.valueOf(j)), bigIntegerArr3[i15]).compareTo(bigInteger9) != 0) {
|
||
|
break;
|
||
|
}
|
||
|
i26 += 2;
|
||
|
bigInteger5 = bigInteger3;
|
||
|
i13 = i5;
|
||
|
bigInteger4 = bigInteger2;
|
||
|
i19 = i6;
|
||
|
}
|
||
|
}
|
||
|
i4 = 1;
|
||
|
bigInteger5 = bigInteger3;
|
||
|
i13 = i5;
|
||
|
bigInteger4 = bigInteger2;
|
||
|
i19 = i6;
|
||
|
i11 = 0;
|
||
|
i14 = 16;
|
||
|
}
|
||
|
int i29 = g + 119;
|
||
|
f = i29 % 128;
|
||
|
if (i29 % 2 == 0) {
|
||
|
i15--;
|
||
|
if (i15 < 0) {
|
||
|
bigIntegerArr[0] = bigIntegerArr3[0];
|
||
|
bigIntegerArr[1] = bigIntegerArr3[1];
|
||
|
bigInteger = bigIntegerArr2[0];
|
||
|
break;
|
||
|
}
|
||
|
i16++;
|
||
|
i7 = 2;
|
||
|
bigInteger5 = bigInteger3;
|
||
|
i13 = i5;
|
||
|
bigInteger4 = bigInteger2;
|
||
|
i4 = 1;
|
||
|
i11 = 0;
|
||
|
i14 = 16;
|
||
|
} else {
|
||
|
i15 += 25;
|
||
|
if (i15 < 0) {
|
||
|
bigIntegerArr[0] = bigIntegerArr3[0];
|
||
|
bigIntegerArr[1] = bigIntegerArr3[1];
|
||
|
bigInteger = bigIntegerArr2[0];
|
||
|
break;
|
||
|
}
|
||
|
i16++;
|
||
|
i7 = 2;
|
||
|
bigInteger5 = bigInteger3;
|
||
|
i13 = i5;
|
||
|
bigInteger4 = bigInteger2;
|
||
|
i4 = 1;
|
||
|
i11 = 0;
|
||
|
i14 = 16;
|
||
|
}
|
||
|
}
|
||
|
bigInteger = bigIntegerArr2[i11];
|
||
|
return bigInteger.intValue();
|
||
|
}
|
||
|
|
||
|
static {
|
||
|
f = 0;
|
||
|
c();
|
||
|
ONE = BigInteger.valueOf(1L);
|
||
|
TWO = BigInteger.valueOf(2L);
|
||
|
int i = g + 57;
|
||
|
f = i % 128;
|
||
|
int i2 = i % 2;
|
||
|
}
|
||
|
}
|