@@ -25,6 +25,7 @@ public class CompositeIndex
2525 private static final Map <ASN1ObjectIdentifier , String > algorithmNames = new HashMap <ASN1ObjectIdentifier , String >();
2626 private static final Map <ASN1ObjectIdentifier , byte []> kemLabels = new HashMap <ASN1ObjectIdentifier , byte []>();
2727 private static final Map <ASN1ObjectIdentifier , AlgorithmParameterSpec []> kpgInitSpecs = new HashMap <ASN1ObjectIdentifier , AlgorithmParameterSpec []>();
28+ private static final Map <ASN1ObjectIdentifier , String []> algorithmAliases = new HashMap <ASN1ObjectIdentifier , String []>();
2829
2930 static
3031 {
@@ -75,8 +76,8 @@ public class CompositeIndex
7576 );
7677
7778 registerKEMAlgorithm (
78- IANAObjectIdentifiers .id_MLKEM768_ECDH_BP256_SHA3_256 ,
79- "MLKEM768-ECDH-BP256 -SHA3-256" ,
79+ IANAObjectIdentifiers .id_MLKEM768_ECDH_brainpoolP256r1_SHA3_256 ,
80+ "MLKEM768-ECDH-brainpoolP256r1 -SHA3-256" ,
8081 Strings .toByteArray ("MLKEM768-BP256" ),
8182 new String []{"ML-KEM-768" , "EC" }
8283 );
@@ -98,8 +99,8 @@ public class CompositeIndex
9899 );
99100
100101 registerKEMAlgorithm (
101- IANAObjectIdentifiers .id_MLKEM1024_ECDH_BP384_SHA3_256 ,
102- "MLKEM1024-ECDH-BP384 -SHA3-256" ,
102+ IANAObjectIdentifiers .id_MLKEM1024_ECDH_brainpoolP384r1_SHA3_256 ,
103+ "MLKEM1024-ECDH-brainpoolP384r1 -SHA3-256" ,
103104 Strings .toByteArray ("MLKEM1024-BP384" ),
104105 new String []{"ML-KEM-1024" , "EC" }
105106 );
@@ -119,6 +120,11 @@ public class CompositeIndex
119120 new String []{"ML-KEM-1024" , "EC" }
120121 );
121122
123+ // The two brainpool sets were originally registered with the curve abbreviated to BP256 /
124+ // BP384; those names are kept as aliases of the draft's spelling.
125+ algorithmAliases .put (IANAObjectIdentifiers .id_MLKEM768_ECDH_brainpoolP256r1_SHA3_256 , new String []{"MLKEM768-ECDH-BP256-SHA3-256" });
126+ algorithmAliases .put (IANAObjectIdentifiers .id_MLKEM1024_ECDH_brainpoolP384r1_SHA3_256 , new String []{"MLKEM1024-ECDH-BP384-SHA3-256" });
127+
122128 // Per-component KeyPairGenerator init specs (in pairing order: ML-KEM first, traditional
123129 // second). The ML-KEM component is generated through its parameter-set-specific
124130 // KeyPairGenerator name ("ML-KEM-768" / "ML-KEM-1024") so it needs no spec.
@@ -128,10 +134,10 @@ public class CompositeIndex
128134 kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM768_X25519_SHA3_256 , new AlgorithmParameterSpec []{null , null });
129135 kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM768_ECDH_P256_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("P-256" )});
130136 kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM768_ECDH_P384_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("P-384" )});
131- kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM768_ECDH_BP256_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("brainpoolP256r1" )});
137+ kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM768_ECDH_brainpoolP256r1_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("brainpoolP256r1" )});
132138 kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM1024_RSA3072_SHA3_256 , new AlgorithmParameterSpec []{null , new RSAKeyGenParameterSpec (3072 , RSAKeyGenParameterSpec .F4 )});
133139 kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM1024_ECDH_P384_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("P-384" )});
134- kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM1024_ECDH_BP384_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("brainpoolP384r1" )});
140+ kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM1024_ECDH_brainpoolP384r1_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("brainpoolP384r1" )});
135141 kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM1024_X448_SHA3_256 , new AlgorithmParameterSpec []{null , null });
136142 kpgInitSpecs .put (IANAObjectIdentifiers .id_MLKEM1024_ECDH_P521_SHA3_256 , new AlgorithmParameterSpec []{null , new ECNamedCurveGenParameterSpec ("P-521" )});
137143 }
@@ -161,6 +167,17 @@ public static String[] getPairing(ASN1ObjectIdentifier algorithm)
161167 return pairings .get (algorithm );
162168 }
163169
170+ /**
171+ * Additional names a composite KEM algorithm is registered under, beyond the one
172+ * {@link #getAlgorithmName} returns. Empty for every parameter set that has only one name.
173+ */
174+ public static String [] getAlgorithmAliases (ASN1ObjectIdentifier algorithm )
175+ {
176+ String [] aliases = algorithmAliases .get (algorithm );
177+
178+ return (aliases != null ) ? aliases : new String [0 ];
179+ }
180+
164181 private static void registerKEMAlgorithm (ASN1ObjectIdentifier oid , String algorithmName ,
165182 byte [] label , String [] pairing )
166183 {
0 commit comments