Skip to content

Commit 74a6244

Browse files
committed
Updated tests to ML-DSA rather than Dilithium
1 parent 67c85f8 commit 74a6244

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

prov/src/test/java/org/bouncycastle/jce/provider/test/PKCS12StoreTest.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import java.security.spec.RSAPublicKeySpec;
2222
import java.util.Enumeration;
2323

24-
import javax.swing.KeyStroke;
25-
2624
import org.bouncycastle.asn1.ASN1BMPString;
2725
import org.bouncycastle.asn1.ASN1Encodable;
2826
import org.bouncycastle.asn1.ASN1InputStream;
@@ -48,12 +46,12 @@
4846
import org.bouncycastle.asn1.x509.KeyPurposeId;
4947
import org.bouncycastle.internal.asn1.misc.MiscObjectIdentifiers;
5048
import org.bouncycastle.jcajce.PKCS12StoreParameter;
49+
import org.bouncycastle.jcajce.spec.MLDSAParameterSpec;
5150
import org.bouncycastle.jce.PKCS12Util;
5251
import org.bouncycastle.jce.interfaces.PKCS12BagAttributeCarrier;
5352
import org.bouncycastle.jce.provider.BouncyCastleProvider;
5453
import org.bouncycastle.jce.provider.JDKPKCS12StoreParameter;
5554
import org.bouncycastle.jce.provider.X509CertificateObject;
56-
import org.bouncycastle.pqc.jcajce.spec.DilithiumParameterSpec;
5755
import org.bouncycastle.pqc.jcajce.spec.FalconParameterSpec;
5856
import org.bouncycastle.pqc.jcajce.spec.NTRUParameterSpec;
5957
import org.bouncycastle.pqc.jcajce.spec.SPHINCSPlusParameterSpec;
@@ -1097,13 +1095,13 @@ private void testGOSTStore()
10971095
private void testDilithiumStore()
10981096
throws Exception
10991097
{
1100-
KeyPairGenerator kpg = KeyPairGenerator.getInstance("Dilithium", "BC");
1098+
KeyPairGenerator kpg = KeyPairGenerator.getInstance("ML-DSA", "BC");
11011099

1102-
kpg.initialize(DilithiumParameterSpec.dilithium3);
1100+
kpg.initialize(MLDSAParameterSpec.ml_dsa_65);
11031101

11041102
KeyPair kp = kpg.generateKeyPair();
11051103

1106-
Certificate cert = TestUtils.createSelfSignedCert("CN=Dilithium Test", "Dilithium3", kp);
1104+
Certificate cert = TestUtils.createSelfSignedCert("CN=Dilithium Test", "ML-DSA-65", kp);
11071105

11081106
KeyStore pkcs12 = KeyStore.getInstance("PKCS12", BC);
11091107

prov/src/test/java/org/bouncycastle/jce/provider/test/TestUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class TestUtils
7474
algIds.put("SHA1withECDSA", new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA1));
7575
algIds.put("SHA256withECDSA", new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256));
7676
algIds.put("Ed448", new AlgorithmIdentifier(EdECObjectIdentifiers.id_Ed448));
77-
algIds.put("Dilithium3", new AlgorithmIdentifier(NISTObjectIdentifiers.id_ml_dsa_65));
77+
algIds.put("ML-DSA-65", new AlgorithmIdentifier(NISTObjectIdentifiers.id_ml_dsa_65));
7878
algIds.put("Falcon-512", new AlgorithmIdentifier(BCObjectIdentifiers.falcon_512));
7979
algIds.put("SPHINCS+", new AlgorithmIdentifier(BCObjectIdentifiers.sphincsPlus_sha2_128f_r3));
8080
}

prov/src/test/java/org/bouncycastle/pqc/jcajce/provider/test/DilithiumKeyPairGeneratorTest.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.security.Security;
88

99
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
10-
import org.bouncycastle.asn1.bc.BCObjectIdentifiers;
1110
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
1211
import org.bouncycastle.jce.provider.BouncyCastleProvider;
1312
import org.bouncycastle.pqc.jcajce.spec.DilithiumParameterSpec;
@@ -43,9 +42,9 @@ public void testKeyPairGeneratorNames()
4342
};
4443

4544
String[] algs = new String[]{
46-
"DILITHIUM2",
47-
"DILITHIUM3",
48-
"DILITHIUM5"
45+
"ML-DSA-44",
46+
"ML-DSA-65",
47+
"ML-DSA-87"
4948
};
5049

5150
for (int i = 0; i != oids.length; i++)

0 commit comments

Comments
 (0)