what-the-bank/sources/org/bouncycastle/jcajce/provider/asymmetric/util/DESUtil.java

35 lines
1.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.jcajce.provider.asymmetric.util;
import java.util.HashSet;
import java.util.Set;
import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.util.Strings;
/* loaded from: classes6.dex */
public class DESUtil {
private static final Set<String> des;
public static void setOddParity(byte[] bArr) {
for (int i = 0; i < bArr.length; i++) {
byte b = bArr[i];
bArr[i] = (byte) ((b & 254) | ((((b >> 7) ^ ((((((b >> 1) ^ (b >> 2)) ^ (b >> 3)) ^ (b >> 4)) ^ (b >> 5)) ^ (b >> 6))) ^ 1) & 1));
}
}
public static boolean isDES(String str) {
return des.contains(Strings.toUpperCase(str));
}
static {
HashSet hashSet = new HashSet();
des = hashSet;
hashSet.add("DES");
hashSet.add("DESEDE");
hashSet.add(OIWObjectIdentifiers.desCBC.getId());
hashSet.add(PKCSObjectIdentifiers.des_EDE3_CBC.getId());
hashSet.add(PKCSObjectIdentifiers.des_EDE3_CBC.getId());
hashSet.add(PKCSObjectIdentifiers.id_alg_CMS3DESwrap.getId());
}
}