216 lines
8.8 KiB
Java
216 lines
8.8 KiB
Java
package o;
|
|
|
|
import com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException;
|
|
import java.security.GeneralSecurityException;
|
|
import o.AbstractC17155uPe;
|
|
import o.AbstractC7124ciP;
|
|
import o.SKK;
|
|
import o.VcS;
|
|
import o.qBy;
|
|
import o.rDx;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.bdj, reason: case insensitive filesystem */
|
|
/* loaded from: classes2.dex */
|
|
public final class C4627bdj {
|
|
private static final qBy<C17617yNd, QKJ> a;
|
|
private static final AbstractC7124ciP<C12361ewk> c;
|
|
private static final VcS<SKK, C12361ewk> d;
|
|
private static final AbstractC17155uPe<QKJ> e;
|
|
|
|
static {
|
|
C1246Yua e2 = oHp.e("type.googleapis.com/google.crypto.tink.AesCmacKey");
|
|
d = new VcS<ParametersT, SerializationT>(SKK.class, C12361ewk.class, new VcS.LWm() { // from class: o.RQy
|
|
}) { // from class: o.VcS.5
|
|
private LWm e;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass5(Class cls, Class cls2, LWm lWm) {
|
|
super(cls, cls2, (byte) 0);
|
|
this.e = lWm;
|
|
}
|
|
};
|
|
c = new AbstractC7124ciP<SerializationT>(e2, C12361ewk.class, new AbstractC7124ciP.IeS() { // from class: o.jKh
|
|
}) { // from class: o.ciP.5
|
|
private IeS e;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass5(C1246Yua e22, Class cls, IeS ieS) {
|
|
super(e22, cls, (byte) 0);
|
|
this.e = ieS;
|
|
}
|
|
};
|
|
a = new qBy<KeyT, SerializationT>(C17617yNd.class, QKJ.class, new qBy.IeS() { // from class: o.oEJ
|
|
}) { // from class: o.qBy.4
|
|
private IeS a;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass4(Class cls, Class cls2, IeS ieS) {
|
|
super(cls, cls2, (byte) 0);
|
|
this.a = ieS;
|
|
}
|
|
};
|
|
e = new AbstractC17155uPe<SerializationT>(e22, QKJ.class, new AbstractC17155uPe.RVV() { // from class: o.XIx
|
|
@Override // o.AbstractC17155uPe.RVV
|
|
public final rMq d(KlU klU, QNr qNr) {
|
|
C17617yNd e3;
|
|
e3 = C4627bdj.e((QKJ) klU, qNr);
|
|
return e3;
|
|
}
|
|
}) { // from class: o.uPe.2
|
|
private RVV e;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass2(C1246Yua e22, Class cls, RVV rvv) {
|
|
super(e22, cls, (byte) 0);
|
|
this.e = rvv;
|
|
}
|
|
|
|
@Override // o.AbstractC17155uPe
|
|
public final rMq b(SerializationT serializationt, QNr qNr) throws GeneralSecurityException {
|
|
return this.e.d(serializationt, qNr);
|
|
}
|
|
};
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.bdj$5, reason: invalid class name */
|
|
/* loaded from: classes2.dex */
|
|
public static /* synthetic */ class AnonymousClass5 {
|
|
static final int[] c;
|
|
|
|
static {
|
|
int[] iArr = new int[Umh.values().length];
|
|
c = iArr;
|
|
try {
|
|
iArr[Umh.TINK.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
c[Umh.CRUNCHY.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
c[Umh.LEGACY.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
c[Umh.RAW.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void d() throws GeneralSecurityException {
|
|
C17456wsg b = C17456wsg.b();
|
|
VcS<SKK, C12361ewk> vcS = d;
|
|
synchronized (b) {
|
|
rDx.HBt hBt = new rDx.HBt(b.b.get());
|
|
rDx.RVV rvv = new rDx.RVV(vcS.a, vcS.b, (byte) 0);
|
|
if (hBt.b.containsKey(rvv)) {
|
|
VcS<?, ?> vcS2 = hBt.b.get(rvv);
|
|
if (!vcS2.equals(vcS) || !vcS.equals(vcS2)) {
|
|
throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: ".concat(String.valueOf(rvv)));
|
|
}
|
|
} else {
|
|
hBt.b.put(rvv, vcS);
|
|
}
|
|
b.b.set(new rDx(hBt, (byte) 0));
|
|
}
|
|
AbstractC7124ciP<C12361ewk> abstractC7124ciP = c;
|
|
synchronized (b) {
|
|
rDx.HBt hBt2 = new rDx.HBt(b.b.get());
|
|
rDx.LWm lWm = new rDx.LWm(abstractC7124ciP.a, abstractC7124ciP.b, (byte) 0);
|
|
if (hBt2.a.containsKey(lWm)) {
|
|
AbstractC7124ciP<?> abstractC7124ciP2 = hBt2.a.get(lWm);
|
|
if (!abstractC7124ciP2.equals(abstractC7124ciP) || !abstractC7124ciP.equals(abstractC7124ciP2)) {
|
|
throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: ".concat(String.valueOf(lWm)));
|
|
}
|
|
} else {
|
|
hBt2.a.put(lWm, abstractC7124ciP);
|
|
}
|
|
b.b.set(new rDx(hBt2, (byte) 0));
|
|
}
|
|
qBy<C17617yNd, QKJ> qby = a;
|
|
synchronized (b) {
|
|
rDx.HBt hBt3 = new rDx.HBt(b.b.get());
|
|
rDx.RVV rvv2 = new rDx.RVV(qby.d, qby.c, (byte) 0);
|
|
if (hBt3.d.containsKey(rvv2)) {
|
|
qBy<?, ?> qby2 = hBt3.d.get(rvv2);
|
|
if (!qby2.equals(qby) || !qby.equals(qby2)) {
|
|
throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: ".concat(String.valueOf(rvv2)));
|
|
}
|
|
} else {
|
|
hBt3.d.put(rvv2, qby);
|
|
}
|
|
b.b.set(new rDx(hBt3, (byte) 0));
|
|
}
|
|
AbstractC17155uPe<QKJ> abstractC17155uPe = e;
|
|
synchronized (b) {
|
|
rDx.HBt hBt4 = new rDx.HBt(b.b.get());
|
|
rDx.LWm lWm2 = new rDx.LWm(abstractC17155uPe.b, abstractC17155uPe.c, (byte) 0);
|
|
if (hBt4.e.containsKey(lWm2)) {
|
|
AbstractC17155uPe<?> abstractC17155uPe2 = hBt4.e.get(lWm2);
|
|
if (!abstractC17155uPe2.equals(abstractC17155uPe) || !abstractC17155uPe.equals(abstractC17155uPe2)) {
|
|
throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: ".concat(String.valueOf(lWm2)));
|
|
}
|
|
} else {
|
|
hBt4.e.put(lWm2, abstractC17155uPe);
|
|
}
|
|
b.b.set(new rDx(hBt4, (byte) 0));
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static C17617yNd e(QKJ qkj, QNr qNr) throws GeneralSecurityException {
|
|
SKK.LWm lWm;
|
|
if (!qkj.d.equals("type.googleapis.com/google.crypto.tink.AesCmacKey")) {
|
|
throw new IllegalArgumentException("Wrong type URL in call to AesCmacParameters.parseParameters");
|
|
}
|
|
try {
|
|
uLy a2 = uLy.a(qkj.a, C1458aEp.c());
|
|
if (a2.version_ != 0) {
|
|
throw new GeneralSecurityException("Only version 0 keys are accepted");
|
|
}
|
|
XTy xTy = a2.params_;
|
|
if (xTy == null) {
|
|
xTy = XTy.a();
|
|
}
|
|
Umh umh = qkj.e;
|
|
int i = xTy.tagSize_;
|
|
int i2 = AnonymousClass5.c[umh.ordinal()];
|
|
if (i2 == 1) {
|
|
lWm = SKK.LWm.a;
|
|
} else if (i2 == 2) {
|
|
lWm = SKK.LWm.b;
|
|
} else if (i2 == 3) {
|
|
lWm = SKK.LWm.d;
|
|
} else if (i2 == 4) {
|
|
lWm = SKK.LWm.c;
|
|
} else {
|
|
StringBuilder sb = new StringBuilder("Unable to parse OutputPrefixType: ");
|
|
if (umh != Umh.UNRECOGNIZED) {
|
|
sb.append(umh.value);
|
|
throw new GeneralSecurityException(sb.toString());
|
|
}
|
|
throw new IllegalArgumentException("Can't get the number of an unknown enum value.");
|
|
}
|
|
SKK e2 = SKK.e(i, lWm);
|
|
byte[] c2 = a2.keyValue_.c();
|
|
if (QNr.e(qNr) == null) {
|
|
throw new NullPointerException("SecretKeyAccess required");
|
|
}
|
|
if (c2 == null) {
|
|
throw new NullPointerException("data must be non-null");
|
|
}
|
|
int length = c2.length;
|
|
if (c2 != null) {
|
|
return C17617yNd.c(e2, new JzX(new C1246Yua(c2, length)), qkj.b);
|
|
}
|
|
throw new NullPointerException("data must be non-null");
|
|
} catch (InvalidProtocolBufferException | IllegalArgumentException unused) {
|
|
throw new GeneralSecurityException("Parsing AesCmacKey failed");
|
|
}
|
|
}
|
|
}
|