86 lines
3.3 KiB
Java
86 lines
3.3 KiB
Java
|
package org.bouncycastle.jcajce.provider.digest;
|
||
|
|
||
|
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
|
||
|
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
|
||
|
import org.bouncycastle.crypto.CipherKeyGenerator;
|
||
|
import org.bouncycastle.crypto.digests.SHA384Digest;
|
||
|
import org.bouncycastle.crypto.macs.HMac;
|
||
|
import org.bouncycastle.crypto.macs.OldHMac;
|
||
|
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.pqc.jcajce.spec.McElieceCCA2KeyGenParameterSpec;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class SHA384 {
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public static class Mappings extends DigestAlgorithmProvider {
|
||
|
private static final String PREFIX = SHA384.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.SHA-384", sb.toString());
|
||
|
configurableProvider.addAlgorithm("Alg.Alias.MessageDigest.SHA384", McElieceCCA2KeyGenParameterSpec.SHA384);
|
||
|
StringBuilder sb2 = new StringBuilder("Alg.Alias.MessageDigest.");
|
||
|
sb2.append(NISTObjectIdentifiers.id_sha384);
|
||
|
configurableProvider.addAlgorithm(sb2.toString(), McElieceCCA2KeyGenParameterSpec.SHA384);
|
||
|
StringBuilder sb3 = new StringBuilder();
|
||
|
sb3.append(str);
|
||
|
sb3.append("$OldSHA384");
|
||
|
configurableProvider.addAlgorithm("Mac.OLDHMACSHA384", sb3.toString());
|
||
|
StringBuilder sb4 = new StringBuilder();
|
||
|
sb4.append(str);
|
||
|
sb4.append("$HashMac");
|
||
|
String obj = sb4.toString();
|
||
|
StringBuilder sb5 = new StringBuilder();
|
||
|
sb5.append(str);
|
||
|
sb5.append("$KeyGenerator");
|
||
|
addHMACAlgorithm(configurableProvider, "SHA384", obj, sb5.toString());
|
||
|
addHMACAlias(configurableProvider, "SHA384", PKCSObjectIdentifiers.id_hmacWithSHA384);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* 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 SHA384Digest((SHA384Digest) this.digest);
|
||
|
return digest;
|
||
|
}
|
||
|
|
||
|
public Digest() {
|
||
|
super(new SHA384Digest());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public static class HashMac extends BaseMac {
|
||
|
public HashMac() {
|
||
|
super(new HMac(new SHA384Digest()));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public static class KeyGenerator extends BaseKeyGenerator {
|
||
|
public KeyGenerator() {
|
||
|
super("HMACSHA384", 384, new CipherKeyGenerator());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public static class OldSHA384 extends BaseMac {
|
||
|
public OldSHA384() {
|
||
|
super(new OldHMac(new SHA384Digest()));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private SHA384() {
|
||
|
}
|
||
|
}
|