package o; import java.security.GeneralSecurityException; import java.util.Collections; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Logger; /* loaded from: classes2.dex */ public final class Jtp { private static final ConcurrentMap c; private static final ConcurrentMap, wbW> j; private static final Logger b = Logger.getLogger(Jtp.class.getName()); private static final AtomicReference a = new AtomicReference<>(new C1128Wem()); private static final ConcurrentMap e = new ConcurrentHashMap(); private static final ConcurrentMap d = new ConcurrentHashMap(); static { new ConcurrentHashMap(); j = new ConcurrentHashMap(); c = new ConcurrentHashMap(); } /* JADX WARN: Removed duplicated region for block: B:25:0x0093 A[EXC_TOP_SPLITTER, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public static void b(o.AbstractC16575pTO r12) throws java.security.GeneralSecurityException { /* Method dump skipped, instructions count: 541 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: o.Jtp.b(o.pTO):void"); } public static void a(wbW wbw) throws GeneralSecurityException { synchronized (Jtp.class) { Class

c2 = wbw.c(); ConcurrentMap, wbW> concurrentMap = j; if (concurrentMap.containsKey(c2)) { wbW wbw2 = concurrentMap.get(c2); if (!wbw.getClass().getName().equals(wbw2.getClass().getName())) { Logger logger = b; StringBuilder sb = new StringBuilder("Attempted overwrite of a registered PrimitiveWrapper for type "); sb.append(c2); logger.warning(sb.toString()); throw new GeneralSecurityException(String.format("PrimitiveWrapper for primitive (%s) is already registered to be %s, cannot be re-registered with %s", c2.getName(), wbw2.getClass().getName(), wbw.getClass().getName())); } } concurrentMap.put(c2, wbw); } } public static

P a(String str, byte[] bArr, Class

cls) throws GeneralSecurityException { return a.get().c(str, cls).d(jra.e(bArr)); } public static P b(FdT fdT, Class

cls) throws GeneralSecurityException { wbW wbw = j.get(cls); if (wbw == null) { StringBuilder sb = new StringBuilder("No wrapper found for "); sb.append(fdT.d.getName()); throw new GeneralSecurityException(sb.toString()); } if (!wbw.e().equals(fdT.d)) { StringBuilder sb2 = new StringBuilder("Wrong input primitive class, expected "); sb2.append(wbw.e()); sb2.append(", got "); sb2.append(fdT.d); throw new GeneralSecurityException(sb2.toString()); } return (P) wbw.d(fdT); } /* JADX INFO: Access modifiers changed from: package-private */ public static Map d() { Map unmodifiableMap; synchronized (Jtp.class) { unmodifiableMap = Collections.unmodifiableMap(c); } return unmodifiableMap; } public static Class d(Class cls) { wbW wbw = j.get(cls); if (wbw == null) { return null; } return wbw.e(); } private Jtp() { } public static

P c(NZO nzo, Class

cls) throws GeneralSecurityException { String str = nzo.typeUrl_; return a.get().c(str, cls).d(nzo.value_); } public static vAr d(Jzs jzs) throws GeneralSecurityException { vAr c2; synchronized (Jtp.class) { RQY e2 = a.get().b(jzs.typeUrl_).e(); if (d.get(jzs.typeUrl_).booleanValue()) { c2 = e2.c(jzs.value_); } else { StringBuilder sb = new StringBuilder("newKey-operation not permitted for key type "); sb.append(jzs.typeUrl_); throw new GeneralSecurityException(sb.toString()); } } return c2; } public static NZO c(Jzs jzs) throws GeneralSecurityException { NZO e2; synchronized (Jtp.class) { RQY e3 = a.get().b(jzs.typeUrl_).e(); if (d.get(jzs.typeUrl_).booleanValue()) { e2 = e3.e(jzs.value_); } else { StringBuilder sb = new StringBuilder("newKey-operation not permitted for key type "); sb.append(jzs.typeUrl_); throw new GeneralSecurityException(sb.toString()); } } return e2; } }