Skip to content

Commit 9077f2f

Browse files
committed
cleaned up use of prototype seed only OID.
1 parent 027f515 commit 9077f2f

File tree

4 files changed

+9
-37
lines changed

4 files changed

+9
-37
lines changed

core/src/main/java/org/bouncycastle/asn1/bc/BCObjectIdentifiers.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -429,20 +429,7 @@ public interface BCObjectIdentifiers
429429
ASN1ObjectIdentifier hqc128 = pqc_kem_hqc.branch("1");
430430
ASN1ObjectIdentifier hqc192 = pqc_kem_hqc.branch("2");
431431
ASN1ObjectIdentifier hqc256 = pqc_kem_hqc.branch("3");
432-
433-
/**
434-
* ML-KEM/ML-DSA seed parameters algorithms - temporary
435-
*/
436-
//TODO: delete before release
437-
ASN1ObjectIdentifier id_id_alg_seed = bc.branch("10");
438-
439-
ASN1ObjectIdentifier id_id_alg_ml_dsa_44_seed = id_id_alg_seed.branch("1");
440-
ASN1ObjectIdentifier id_id_alg_ml_dsa_65_seed = id_id_alg_seed.branch("2");
441-
ASN1ObjectIdentifier id_id_alg_ml_dsa_87_seed = id_id_alg_seed.branch("3");
442-
ASN1ObjectIdentifier id_id_alg_ml_kem_512_seed = id_id_alg_seed.branch("4");
443-
ASN1ObjectIdentifier id_id_alg_ml_kem_768_seed = id_id_alg_seed.branch("5");
444-
ASN1ObjectIdentifier id_id_alg_ml_kem_1024_seed = id_id_alg_seed.branch("6");
445-
432+
446433
/**
447434
* Mayo
448435
*/

core/src/main/java/org/bouncycastle/pqc/crypto/util/Utils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,6 @@ class Utils
284284
mldsaParams.put(NISTObjectIdentifiers.id_ml_dsa_44, MLDSAParameters.ml_dsa_44);
285285
mldsaParams.put(NISTObjectIdentifiers.id_ml_dsa_65, MLDSAParameters.ml_dsa_65);
286286
mldsaParams.put(NISTObjectIdentifiers.id_ml_dsa_87, MLDSAParameters.ml_dsa_87);
287-
mldsaParams.put(BCObjectIdentifiers.id_id_alg_ml_dsa_44_seed, MLDSAParameters.ml_dsa_44);
288-
mldsaParams.put(BCObjectIdentifiers.id_id_alg_ml_dsa_65_seed, MLDSAParameters.ml_dsa_65);
289-
mldsaParams.put(BCObjectIdentifiers.id_id_alg_ml_dsa_87_seed, MLDSAParameters.ml_dsa_87);
290287
mldsaParams.put(NISTObjectIdentifiers.id_hash_ml_dsa_44_with_sha512, MLDSAParameters.ml_dsa_44_with_sha512);
291288
mldsaParams.put(NISTObjectIdentifiers.id_hash_ml_dsa_65_with_sha512, MLDSAParameters.ml_dsa_65_with_sha512);
292289
mldsaParams.put(NISTObjectIdentifiers.id_hash_ml_dsa_87_with_sha512, MLDSAParameters.ml_dsa_87_with_sha512);

prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/mldsa/MLDSAKeyFactorySpi.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.util.Set;
1414

1515
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
16-
import org.bouncycastle.asn1.bc.BCObjectIdentifiers;
1716
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
1817
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo;
1918
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
@@ -54,9 +53,9 @@ public MLDSAKeyFactorySpi(Set<ASN1ObjectIdentifier> keyOids)
5453
this.isHashOnly = false;
5554
}
5655

57-
public MLDSAKeyFactorySpi(ASN1ObjectIdentifier keyOid, ASN1ObjectIdentifier seedOid)
56+
public MLDSAKeyFactorySpi(ASN1ObjectIdentifier keyOid)
5857
{
59-
super(setOf(keyOid, seedOid));
58+
super(keyOid);
6059

6160
this.isHashOnly = (keyOid.equals(NISTObjectIdentifiers.id_hash_ml_dsa_44_with_sha512)
6261
|| keyOid.equals(NISTObjectIdentifiers.id_hash_ml_dsa_65_with_sha512)
@@ -227,7 +226,7 @@ public static class MLDSA44
227226
{
228227
public MLDSA44()
229228
{
230-
super(NISTObjectIdentifiers.id_ml_dsa_44, BCObjectIdentifiers.id_id_alg_ml_dsa_44_seed);
229+
super(NISTObjectIdentifiers.id_ml_dsa_44);
231230
}
232231
}
233232

@@ -236,7 +235,7 @@ public static class MLDSA65
236235
{
237236
public MLDSA65()
238237
{
239-
super(NISTObjectIdentifiers.id_ml_dsa_65, BCObjectIdentifiers.id_id_alg_ml_dsa_65_seed);
238+
super(NISTObjectIdentifiers.id_ml_dsa_65);
240239
}
241240
}
242241

@@ -245,7 +244,7 @@ public static class MLDSA87
245244
{
246245
public MLDSA87()
247246
{
248-
super(NISTObjectIdentifiers.id_ml_dsa_87, BCObjectIdentifiers.id_id_alg_ml_dsa_87_seed);
247+
super(NISTObjectIdentifiers.id_ml_dsa_87);
249248
}
250249
}
251250

@@ -263,7 +262,7 @@ public static class HashMLDSA44
263262
{
264263
public HashMLDSA44()
265264
{
266-
super(NISTObjectIdentifiers.id_hash_ml_dsa_44_with_sha512, BCObjectIdentifiers.id_id_alg_ml_dsa_44_seed);
265+
super(NISTObjectIdentifiers.id_hash_ml_dsa_44_with_sha512);
267266
}
268267
}
269268

@@ -272,7 +271,7 @@ public static class HashMLDSA65
272271
{
273272
public HashMLDSA65()
274273
{
275-
super(NISTObjectIdentifiers.id_hash_ml_dsa_65_with_sha512, BCObjectIdentifiers.id_id_alg_ml_dsa_65_seed);
274+
super(NISTObjectIdentifiers.id_hash_ml_dsa_65_with_sha512);
276275
}
277276
}
278277

@@ -281,7 +280,7 @@ public static class HashMLDSA87
281280
{
282281
public HashMLDSA87()
283282
{
284-
super(NISTObjectIdentifiers.id_hash_ml_dsa_87_with_sha512, BCObjectIdentifiers.id_id_alg_ml_dsa_87_seed);
283+
super(NISTObjectIdentifiers.id_hash_ml_dsa_87_with_sha512);
285284
}
286285
}
287286
}

prov/src/main/java/org/bouncycastle/pqc/jcajce/provider/util/BaseKeyFactorySpi.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.security.spec.KeySpec;
88
import java.security.spec.PKCS8EncodedKeySpec;
99
import java.security.spec.X509EncodedKeySpec;
10-
import java.util.HashSet;
1110
import java.util.Set;
1211

1312
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
@@ -34,16 +33,6 @@ protected BaseKeyFactorySpi(ASN1ObjectIdentifier keyOid)
3433
this.keyOids = null;
3534
}
3635

37-
protected static Set setOf(ASN1ObjectIdentifier oid1, ASN1ObjectIdentifier oid2)
38-
{
39-
Set hashSet = new HashSet(2);
40-
41-
hashSet.add(oid1);
42-
hashSet.add(oid2);
43-
44-
return hashSet;
45-
}
46-
4736
public PrivateKey engineGeneratePrivate(KeySpec keySpec)
4837
throws InvalidKeySpecException
4938
{

0 commit comments

Comments
 (0)