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

108 lines
3.6 KiB
Java

package o;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.logging.Logger;
import o.FdT;
import o.InterfaceC17129uEO;
/* renamed from: o.bpO, reason: case insensitive filesystem */
/* loaded from: classes2.dex */
public class C5242bpO implements wbW<GHh, GHh> {
private static final Logger a = Logger.getLogger(C5242bpO.class.getName());
/* renamed from: o.bpO$IeS */
/* loaded from: classes2.dex */
public static class IeS implements GHh {
private final InterfaceC17129uEO.IeS c;
private final InterfaceC17129uEO.IeS d;
private final FdT<GHh> e;
public IeS(FdT<GHh> fdT) {
this.e = fdT;
if (!(!fdT.e.b.isEmpty())) {
this.c = MWX.b;
this.d = MWX.b;
return;
}
InterfaceC17129uEO interfaceC17129uEO = UqK.d().a.get();
interfaceC17129uEO = interfaceC17129uEO == null ? UqK.d : interfaceC17129uEO;
MWX.d(fdT);
this.c = interfaceC17129uEO.d();
this.d = interfaceC17129uEO.d();
}
@Override // o.GHh
public final byte[] a(byte[] bArr, byte[] bArr2) throws GeneralSecurityException {
if (bArr.length > 5) {
byte[] copyOf = Arrays.copyOf(bArr, 5);
byte[] copyOfRange = Arrays.copyOfRange(bArr, 5, bArr.length);
List<FdT.HBt<GHh>> list = this.e.c.get(new FdT.LWm(copyOf, (byte) 0));
if (list == null) {
list = Collections.emptyList();
}
for (FdT.HBt<GHh> hBt : list) {
try {
byte[] a = hBt.e.a(copyOfRange, bArr2);
int i = hBt.d;
int length = copyOfRange.length;
return a;
} catch (GeneralSecurityException e) {
C5242bpO.a.info("ciphertext prefix matches a key, but cannot decrypt: ".concat(String.valueOf(e)));
}
}
}
List<FdT.HBt<GHh>> list2 = this.e.c.get(new FdT.LWm(sPU.b, (byte) 0));
if (list2 == null) {
list2 = Collections.emptyList();
}
for (FdT.HBt<GHh> hBt2 : list2) {
try {
byte[] a2 = hBt2.e.a(bArr, bArr2);
int i2 = hBt2.d;
int length2 = bArr.length;
return a2;
} catch (GeneralSecurityException unused) {
}
}
throw new GeneralSecurityException("decryption failed");
}
@Override // o.GHh
public final byte[] e(byte[] bArr, byte[] bArr2) throws GeneralSecurityException {
byte[][] bArr3 = new byte[2];
byte[] bArr4 = this.e.a.b;
bArr3[0] = bArr4 == null ? null : Arrays.copyOf(bArr4, bArr4.length);
bArr3[1] = this.e.a.e.e(bArr, bArr2);
byte[] a = vil.a(bArr3);
int i = this.e.a.d;
int length = bArr.length;
return a;
}
}
C5242bpO() {
}
@Override // o.wbW
public final Class<GHh> c() {
return GHh.class;
}
@Override // o.wbW
public final Class<GHh> e() {
return GHh.class;
}
public static void b() throws GeneralSecurityException {
Jtp.a(new C5242bpO());
}
@Override // o.wbW
public final /* synthetic */ GHh d(FdT<GHh> fdT) throws GeneralSecurityException {
return new IeS(fdT);
}
}