what-the-bank/sources/org/bouncycastle/jcajce/provider/digest/GOST3411.java

183 lines
8.2 KiB
Java

package org.bouncycastle.jcajce.provider.digest;
import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers;
import org.bouncycastle.asn1.rosstandart.RosstandartObjectIdentifiers;
import org.bouncycastle.crypto.CipherKeyGenerator;
import org.bouncycastle.crypto.digests.GOST3411Digest;
import org.bouncycastle.crypto.digests.GOST3411_2012_256Digest;
import org.bouncycastle.crypto.digests.GOST3411_2012_512Digest;
import org.bouncycastle.crypto.macs.HMac;
import org.bouncycastle.jcajce.provider.config.ConfigurableProvider;
import org.bouncycastle.jcajce.provider.symmetric.util.BaseKeyGenerator;
import org.bouncycastle.jcajce.provider.symmetric.util.BaseMac;
import org.bouncycastle.jcajce.provider.symmetric.util.PBESecretKeyFactory;
/* loaded from: classes6.dex */
public class GOST3411 {
/* loaded from: classes6.dex */
public static class Mappings extends DigestAlgorithmProvider {
private static final String PREFIX = GOST3411.class.getName();
@Override // org.bouncycastle.jcajce.provider.util.AlgorithmProvider
public void configure(ConfigurableProvider configurableProvider) {
StringBuilder sb = new StringBuilder();
String str = PREFIX;
sb.append(str);
sb.append("$Digest");
configurableProvider.addAlgorithm("MessageDigest.GOST3411", sb.toString());
configurableProvider.addAlgorithm("Alg.Alias.MessageDigest.GOST", "GOST3411");
configurableProvider.addAlgorithm("Alg.Alias.MessageDigest.GOST-3411", "GOST3411");
StringBuilder sb2 = new StringBuilder("Alg.Alias.MessageDigest.");
sb2.append(CryptoProObjectIdentifiers.gostR3411);
configurableProvider.addAlgorithm(sb2.toString(), "GOST3411");
StringBuilder sb3 = new StringBuilder();
sb3.append(str);
sb3.append("$HashMac");
String obj = sb3.toString();
StringBuilder sb4 = new StringBuilder();
sb4.append(str);
sb4.append("$KeyGenerator");
addHMACAlgorithm(configurableProvider, "GOST3411", obj, sb4.toString());
addHMACAlias(configurableProvider, "GOST3411", CryptoProObjectIdentifiers.gostR3411);
StringBuilder sb5 = new StringBuilder();
sb5.append(str);
sb5.append("$Digest2012_256");
configurableProvider.addAlgorithm("MessageDigest.GOST3411-2012-256", sb5.toString());
configurableProvider.addAlgorithm("Alg.Alias.MessageDigest.GOST-2012-256", "GOST3411-2012-256");
configurableProvider.addAlgorithm("Alg.Alias.MessageDigest.GOST-3411-2012-256", "GOST3411-2012-256");
StringBuilder sb6 = new StringBuilder("Alg.Alias.MessageDigest.");
sb6.append(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256);
configurableProvider.addAlgorithm(sb6.toString(), "GOST3411-2012-256");
StringBuilder sb7 = new StringBuilder();
sb7.append(str);
sb7.append("$HashMac2012_256");
String obj2 = sb7.toString();
StringBuilder sb8 = new StringBuilder();
sb8.append(str);
sb8.append("$KeyGenerator2012_256");
addHMACAlgorithm(configurableProvider, "GOST3411-2012-256", obj2, sb8.toString());
addHMACAlias(configurableProvider, "GOST3411-2012-256", RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_256);
StringBuilder sb9 = new StringBuilder();
sb9.append(str);
sb9.append("$Digest2012_512");
configurableProvider.addAlgorithm("MessageDigest.GOST3411-2012-512", sb9.toString());
configurableProvider.addAlgorithm("Alg.Alias.MessageDigest.GOST-2012-512", "GOST3411-2012-512");
configurableProvider.addAlgorithm("Alg.Alias.MessageDigest.GOST-3411-2012-512", "GOST3411-2012-512");
StringBuilder sb10 = new StringBuilder("Alg.Alias.MessageDigest.");
sb10.append(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512);
configurableProvider.addAlgorithm(sb10.toString(), "GOST3411-2012-512");
StringBuilder sb11 = new StringBuilder();
sb11.append(str);
sb11.append("$HashMac2012_512");
String obj3 = sb11.toString();
StringBuilder sb12 = new StringBuilder();
sb12.append(str);
sb12.append("$KeyGenerator2012_512");
addHMACAlgorithm(configurableProvider, "GOST3411-2012-512", obj3, sb12.toString());
addHMACAlias(configurableProvider, "GOST3411-2012-512", RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_512);
StringBuilder sb13 = new StringBuilder();
sb13.append(str);
sb13.append("$PBEWithMacKeyFactory");
configurableProvider.addAlgorithm("SecretKeyFactory.PBEWITHHMACGOST3411", sb13.toString());
StringBuilder sb14 = new StringBuilder("Alg.Alias.SecretKeyFactory.");
sb14.append(CryptoProObjectIdentifiers.gostR3411);
configurableProvider.addAlgorithm(sb14.toString(), "PBEWITHHMACGOST3411");
}
}
/* loaded from: classes6.dex */
public static class Digest extends BCMessageDigest implements Cloneable {
@Override // java.security.MessageDigest, java.security.MessageDigestSpi
public Object clone() throws CloneNotSupportedException {
Digest digest = (Digest) super.clone();
digest.digest = new GOST3411Digest((GOST3411Digest) this.digest);
return digest;
}
public Digest() {
super(new GOST3411Digest());
}
}
/* loaded from: classes6.dex */
public static class Digest2012_256 extends BCMessageDigest implements Cloneable {
@Override // java.security.MessageDigest, java.security.MessageDigestSpi
public Object clone() throws CloneNotSupportedException {
Digest2012_256 digest2012_256 = (Digest2012_256) super.clone();
digest2012_256.digest = new GOST3411_2012_256Digest((GOST3411_2012_256Digest) this.digest);
return digest2012_256;
}
public Digest2012_256() {
super(new GOST3411_2012_256Digest());
}
}
/* loaded from: classes6.dex */
public static class Digest2012_512 extends BCMessageDigest implements Cloneable {
@Override // java.security.MessageDigest, java.security.MessageDigestSpi
public Object clone() throws CloneNotSupportedException {
Digest2012_512 digest2012_512 = (Digest2012_512) super.clone();
digest2012_512.digest = new GOST3411_2012_512Digest((GOST3411_2012_512Digest) this.digest);
return digest2012_512;
}
public Digest2012_512() {
super(new GOST3411_2012_512Digest());
}
}
/* loaded from: classes6.dex */
public static class HashMac extends BaseMac {
public HashMac() {
super(new HMac(new GOST3411Digest()));
}
}
/* loaded from: classes6.dex */
public static class HashMac2012_256 extends BaseMac {
public HashMac2012_256() {
super(new HMac(new GOST3411_2012_256Digest()));
}
}
/* loaded from: classes6.dex */
public static class HashMac2012_512 extends BaseMac {
public HashMac2012_512() {
super(new HMac(new GOST3411_2012_512Digest()));
}
}
/* loaded from: classes6.dex */
public static class KeyGenerator extends BaseKeyGenerator {
public KeyGenerator() {
super("HMACGOST3411", 256, new CipherKeyGenerator());
}
}
/* loaded from: classes6.dex */
public static class KeyGenerator2012_256 extends BaseKeyGenerator {
public KeyGenerator2012_256() {
super("HMACGOST3411", 256, new CipherKeyGenerator());
}
}
/* loaded from: classes6.dex */
public static class KeyGenerator2012_512 extends BaseKeyGenerator {
public KeyGenerator2012_512() {
super("HMACGOST3411", 512, new CipherKeyGenerator());
}
}
/* loaded from: classes6.dex */
public static class PBEWithMacKeyFactory extends PBESecretKeyFactory {
public PBEWithMacKeyFactory() {
super("PBEwithHmacGOST3411", null, false, 2, 6, 256, 0);
}
}
private GOST3411() {
}
}