88 lines
1.9 KiB
Java
88 lines
1.9 KiB
Java
package com.google.zxing.pdf417.decoder.ec;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class ModulusGF {
|
|
public static final ModulusGF f = new ModulusGF(929, 3);
|
|
private final int[] a;
|
|
private final int[] b;
|
|
private final ModulusPoly c;
|
|
private final ModulusPoly d;
|
|
private final int e;
|
|
|
|
private ModulusGF(int i, int i2) {
|
|
this.e = i;
|
|
this.a = new int[i];
|
|
this.b = new int[i];
|
|
int i3 = 1;
|
|
for (int i4 = 0; i4 < i; i4++) {
|
|
this.a[i4] = i3;
|
|
i3 = (i3 * i2) % i;
|
|
}
|
|
for (int i5 = 0; i5 < i - 1; i5++) {
|
|
this.b[this.a[i5]] = i5;
|
|
}
|
|
this.c = new ModulusPoly(this, new int[]{0});
|
|
this.d = new ModulusPoly(this, new int[]{1});
|
|
}
|
|
|
|
ModulusPoly a() {
|
|
return this.d;
|
|
}
|
|
|
|
ModulusPoly b(int i, int i2) {
|
|
if (i < 0) {
|
|
throw new IllegalArgumentException();
|
|
}
|
|
if (i2 == 0) {
|
|
return this.c;
|
|
}
|
|
int[] iArr = new int[i + 1];
|
|
iArr[0] = i2;
|
|
return new ModulusPoly(this, iArr);
|
|
}
|
|
|
|
ModulusPoly c() {
|
|
return this.c;
|
|
}
|
|
|
|
int d(int i, int i2) {
|
|
int i3 = this.e;
|
|
return ((i + i3) - i2) % i3;
|
|
}
|
|
|
|
int a(int i, int i2) {
|
|
return (i + i2) % this.e;
|
|
}
|
|
|
|
int c(int i) {
|
|
if (i != 0) {
|
|
return this.b[i];
|
|
}
|
|
throw new IllegalArgumentException();
|
|
}
|
|
|
|
int a(int i) {
|
|
return this.a[i];
|
|
}
|
|
|
|
int c(int i, int i2) {
|
|
if (i == 0 || i2 == 0) {
|
|
return 0;
|
|
}
|
|
int[] iArr = this.a;
|
|
int[] iArr2 = this.b;
|
|
return iArr[(iArr2[i] + iArr2[i2]) % (this.e - 1)];
|
|
}
|
|
|
|
int b(int i) {
|
|
if (i != 0) {
|
|
return this.a[(this.e - this.b[i]) - 1];
|
|
}
|
|
throw new ArithmeticException();
|
|
}
|
|
|
|
int b() {
|
|
return this.e;
|
|
}
|
|
}
|