|
55 | 55 | public class CompositeSignaturesTest |
56 | 56 | extends TestCase |
57 | 57 | { |
58 | | - public static void main(String[] args) |
59 | | - throws Exception |
60 | | - { |
61 | | - CompositeSignaturesTest test = new CompositeSignaturesTest(); |
62 | | - test.setUp(); |
63 | | - List<Map<String, Object>> testVectors = test.readTestVectorsFromJson("pqc/crypto/composite", "testvectors.json"); |
64 | | - test.compositeSignaturesTest(testVectors); |
65 | | - test.testSigningAndVerificationInternal(); |
66 | | - } |
67 | | - |
68 | 58 | private static String[] compositeSignaturesOIDs = { |
69 | 59 | "1.3.6.1.5.5.7.6.37", // id_MLDSA44_RSA2048_PSS_SHA256 |
70 | 60 | "1.3.6.1.5.5.7.6.38", // id_MLDSA44_RSA2048_PKCS15_SHA256 |
@@ -245,6 +235,43 @@ private void check_ECDSA_Composite(String firstAlg, CompositePublicKey compPub, |
245 | 235 | TestCase.assertEquals("EC", compPriv.getPrivateKeys().get(1).getAlgorithm()); |
246 | 236 | } |
247 | 237 |
|
| 238 | + public void testKeyBuilders() |
| 239 | + throws Exception |
| 240 | + { |
| 241 | + String[] algorithms = new String[]{ |
| 242 | + "MLDSA44-RSA2048-PSS-SHA256", |
| 243 | + "MLDSA44-RSA2048-PKCS15-SHA256", |
| 244 | + "MLDSA44-Ed25519-SHA512", |
| 245 | + "MLDSA44-ECDSA-P256-SHA256", |
| 246 | + "MLDSA65-RSA3072-PSS-SHA512", |
| 247 | + "MLDSA65-RSA3072-PKCS15-SHA512", |
| 248 | + "MLDSA65-RSA4096-PSS-SHA512", |
| 249 | + "MLDSA65-RSA4096-PKCS15-SHA512", |
| 250 | + "MLDSA65-ECDSA-P256-SHA512", |
| 251 | + "MLDSA65-ECDSA-P384-SHA512", |
| 252 | + "MLDSA65-ECDSA-brainpoolP256r1-SHA512", |
| 253 | + "MLDSA65-Ed25519-SHA512", |
| 254 | + "MLDSA87-ECDSA-P384-SHA512", |
| 255 | + "MLDSA87-ECDSA-brainpoolP384R1-SHA512", |
| 256 | + "MLDSA87-Ed448-SHAKE256", |
| 257 | + "MLDSA87-RSA4096-PSS-SHA512", |
| 258 | + "MLDSA87-ECDSA-P521-SHA512", |
| 259 | + "MLDSA87-RSA3072-PSS-SHA512" |
| 260 | + }; |
| 261 | + |
| 262 | + CompositePublicKey.Builder pubBuilder = null; |
| 263 | + CompositePrivateKey.Builder privBuilder = null; |
| 264 | + |
| 265 | + for (int i = 0; i != algorithms.length; i++) |
| 266 | + { |
| 267 | + pubBuilder = CompositePublicKey.builder(algorithms[i]); |
| 268 | + privBuilder = CompositePrivateKey.builder(algorithms[i]); |
| 269 | + } |
| 270 | + |
| 271 | + assertNotNull(pubBuilder); |
| 272 | + assertNotNull(privBuilder); |
| 273 | + } |
| 274 | + |
248 | 275 | public void testSelfComposition() |
249 | 276 | throws Exception |
250 | 277 | { |
|
0 commit comments