what-the-bank/sources/o/FdT.java

204 lines
6.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import o.NZO;
import o.Yzk;
/* loaded from: classes2.dex */
public final class FdT<P> {
public HBt<P> a;
private final boolean b;
public final ConcurrentMap<LWm, List<HBt<P>>> c;
final Class<P> d;
public final yiD e;
/* JADX INFO: Access modifiers changed from: package-private */
public /* synthetic */ FdT(ConcurrentMap concurrentMap, HBt hBt, yiD yid, Class cls, byte b) {
this(concurrentMap, hBt, yid, cls);
}
/* loaded from: classes2.dex */
public static final class HBt<P> {
public final rMq a;
public final byte[] b;
public final Umh c;
public final int d;
public final P e;
public final NzM g;
HBt(P p, byte[] bArr, NzM nzM, Umh umh, int i, rMq rmq) {
this.e = p;
this.b = Arrays.copyOf(bArr, bArr.length);
this.g = nzM;
this.c = umh;
this.d = i;
this.a = rmq;
}
}
private FdT(ConcurrentMap<LWm, List<HBt<P>>> concurrentMap, HBt<P> hBt, yiD yid, Class<P> cls) {
this.c = concurrentMap;
this.a = hBt;
this.d = cls;
this.e = yid;
this.b = false;
}
/* loaded from: classes2.dex */
public static class LWm implements Comparable<LWm> {
private final byte[] a;
public /* synthetic */ LWm(byte[] bArr, byte b) {
this(bArr);
}
@Override // java.lang.Comparable
public final /* bridge */ /* synthetic */ int compareTo(LWm lWm) {
LWm lWm2 = lWm;
byte[] bArr = this.a;
int length = bArr.length;
byte[] bArr2 = lWm2.a;
if (length != bArr2.length) {
return bArr.length - bArr2.length;
}
int i = 0;
while (true) {
byte[] bArr3 = this.a;
if (i >= bArr3.length) {
return 0;
}
byte b = bArr3[i];
byte b2 = lWm2.a[i];
if (b != b2) {
return b - b2;
}
i++;
}
}
private LWm(byte[] bArr) {
this.a = Arrays.copyOf(bArr, bArr.length);
}
public final int hashCode() {
return Arrays.hashCode(this.a);
}
public final boolean equals(Object obj) {
if (obj instanceof LWm) {
return Arrays.equals(this.a, ((LWm) obj).a);
}
return false;
}
public final String toString() {
return nxt.b(this.a);
}
}
/* loaded from: classes2.dex */
public static class RVV<P> {
yiD a;
final Class<P> c;
ConcurrentMap<LWm, List<HBt<P>>> d;
HBt<P> e;
/* JADX INFO: Access modifiers changed from: package-private */
public /* synthetic */ RVV(Class cls, byte b) {
this(cls);
}
/* JADX INFO: Access modifiers changed from: package-private */
public final RVV<P> e(P p, Yzk.IeS ieS, boolean z) throws GeneralSecurityException {
if (this.d == null) {
throw new IllegalStateException("addPrimitive cannot be called after build");
}
NzM a = NzM.a(ieS.status_);
if (a == null) {
a = NzM.UNRECOGNIZED;
}
if (a != NzM.ENABLED) {
throw new GeneralSecurityException("only ENABLED key is allowed");
}
HBt<P> a2 = FdT.a(p, ieS, this.d);
if (z) {
if (this.e != null) {
throw new IllegalStateException("you cannot set two primary primitives");
}
this.e = a2;
}
return this;
}
private RVV(Class<P> cls) {
this.d = new ConcurrentHashMap();
this.c = cls;
this.a = yiD.a;
}
}
static /* synthetic */ HBt a(Object obj, Yzk.IeS ieS, ConcurrentMap concurrentMap) throws GeneralSecurityException {
Integer valueOf = Integer.valueOf(ieS.keyId_);
Umh b = Umh.b(ieS.outputPrefixType_);
if (b == null) {
b = Umh.UNRECOGNIZED;
}
if (b == Umh.RAW) {
valueOf = null;
}
C17456wsg b2 = C17456wsg.b();
NZO nzo = ieS.keyData_;
if (nzo == null) {
nzo = NZO.a();
}
String str = nzo.typeUrl_;
NZO nzo2 = ieS.keyData_;
if (nzo2 == null) {
nzo2 = NZO.a();
}
jra jraVar = nzo2.value_;
NZO nzo3 = ieS.keyData_;
if (nzo3 == null) {
nzo3 = NZO.a();
}
NZO.Sts a = NZO.Sts.a(nzo3.keyMaterialType_);
if (a == null) {
a = NZO.Sts.UNRECOGNIZED;
}
Umh b3 = Umh.b(ieS.outputPrefixType_);
if (b3 == null) {
b3 = Umh.UNRECOGNIZED;
}
rMq b4 = b2.b(QKJ.c(str, jraVar, a, b3, valueOf), QNr.e());
byte[] a2 = sPU.a(ieS);
NzM a3 = NzM.a(ieS.status_);
if (a3 == null) {
a3 = NzM.UNRECOGNIZED;
}
NzM nzM = a3;
Umh b5 = Umh.b(ieS.outputPrefixType_);
if (b5 == null) {
b5 = Umh.UNRECOGNIZED;
}
HBt hBt = new HBt(obj, a2, nzM, b5, ieS.keyId_, b4);
ArrayList arrayList = new ArrayList();
arrayList.add(hBt);
byte[] bArr = hBt.b;
LWm lWm = new LWm(bArr != null ? Arrays.copyOf(bArr, bArr.length) : null, (byte) 0);
List list = (List) concurrentMap.put(lWm, Collections.unmodifiableList(arrayList));
if (list != null) {
ArrayList arrayList2 = new ArrayList();
arrayList2.addAll(list);
arrayList2.add(hBt);
concurrentMap.put(lWm, Collections.unmodifiableList(arrayList2));
}
return hBt;
}
}