package o; import java.util.Collection; import java.util.Collections; import org.bouncycastle.crypto.tls.CipherSuite; /* loaded from: classes2.dex */ public final class ElF extends Ggl { @Override // o.Ggl protected final Collection b() { return Collections.singleton(PTS.CODE_39); } @Override // o.Ggl public final boolean[] d(String str) { int length = str.length(); if (length > 80) { throw new IllegalArgumentException("Requested contents should be less than 80 digits long, but got ".concat(String.valueOf(length))); } int i = 0; while (true) { if (i >= length) { break; } if ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%".indexOf(str.charAt(i)) < 0) { int length2 = str.length(); StringBuilder sb = new StringBuilder(); for (int i2 = 0; i2 < length2; i2++) { char charAt = str.charAt(i2); if (charAt == 0) { sb.append("%U"); } else { if (charAt != ' ') { if (charAt == '@') { sb.append("%V"); } else if (charAt == '`') { sb.append("%W"); } else if (charAt != '-' && charAt != '.') { if (charAt <= 26) { sb.append('$'); sb.append((char) (charAt + '@')); } else if (charAt < ' ') { sb.append('%'); sb.append((char) (charAt + '&')); } else if (charAt <= ',' || charAt == '/' || charAt == ':') { sb.append('/'); sb.append((char) (charAt + ' ')); } else if (charAt <= '9') { sb.append(charAt); } else if (charAt <= '?') { sb.append('%'); sb.append((char) (charAt + 11)); } else if (charAt <= 'Z') { sb.append(charAt); } else if (charAt <= '_') { sb.append('%'); sb.append((char) (charAt - 16)); } else if (charAt <= 'z') { sb.append('+'); sb.append((char) (charAt - ' ')); } else if (charAt <= 127) { sb.append('%'); sb.append((char) (charAt - '+')); } else { StringBuilder sb2 = new StringBuilder("Requested content contains a non-encodable character: '"); sb2.append(str.charAt(i2)); sb2.append("'"); throw new IllegalArgumentException(sb2.toString()); } } } sb.append(charAt); } } str = sb.toString(); length = str.length(); if (length > 80) { StringBuilder sb3 = new StringBuilder("Requested contents should be less than 80 digits long, but got "); sb3.append(length); sb3.append(" (extended full ASCII mode)"); throw new IllegalArgumentException(sb3.toString()); } } else { i++; } } int[] iArr = new int[9]; boolean[] zArr = new boolean[(length * 13) + 25]; a(CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA, iArr); int b = b(zArr, 0, iArr, true); int[] iArr2 = {1}; int b2 = b + b(zArr, b, iArr2, false); for (int i3 = 0; i3 < length; i3++) { a(C16068krh.e["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%".indexOf(str.charAt(i3))], iArr); int b3 = b2 + b(zArr, b2, iArr, true); b2 = b3 + b(zArr, b3, iArr2, false); } a(CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA, iArr); b(zArr, b2, iArr, true); return zArr; } private static void a(int i, int[] iArr) { for (int i2 = 0; i2 < 9; i2++) { int i3 = 1; if (((1 << (8 - i2)) & i) != 0) { i3 = 2; } iArr[i2] = i3; } } }