Skip to content

Commit

Permalink
added generic XMSS/XMSS^MT signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Oct 14, 2019
1 parent 49cd184 commit 02e2488
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,17 @@ public class DefaultSignatureAlgorithmIdentifierFinder
algorithms.put("SHAKE128WITHXMSSMT-SHAKE128", BCObjectIdentifiers.xmss_mt_SHAKE128ph);
algorithms.put("SHAKE256WITHXMSSMT-SHAKE256", BCObjectIdentifiers.xmss_mt_SHAKE256ph);

algorithms.put("XMSS-SHA256", IsaraObjectIdentifiers.id_alg_xmss);
algorithms.put("XMSS-SHA512", IsaraObjectIdentifiers.id_alg_xmss);
algorithms.put("XMSS-SHAKE128", IsaraObjectIdentifiers.id_alg_xmss);
algorithms.put("XMSS-SHAKE256", IsaraObjectIdentifiers.id_alg_xmss);

algorithms.put("XMSSMT-SHA256", IsaraObjectIdentifiers.id_alg_xmssmt);
algorithms.put("XMSSMT-SHA512", IsaraObjectIdentifiers.id_alg_xmssmt);
algorithms.put("XMSSMT-SHAKE128", IsaraObjectIdentifiers.id_alg_xmssmt);
algorithms.put("XMSSMT-SHAKE256", IsaraObjectIdentifiers.id_alg_xmssmt);
algorithms.put("XMSS", IsaraObjectIdentifiers.id_alg_xmss);
algorithms.put("XMSS-SHA256", BCObjectIdentifiers.xmss_SHA256);
algorithms.put("XMSS-SHA512", BCObjectIdentifiers.xmss_SHA512);
algorithms.put("XMSS-SHAKE128", BCObjectIdentifiers.xmss_SHAKE128);
algorithms.put("XMSS-SHAKE256", BCObjectIdentifiers.xmss_SHAKE256);

algorithms.put("XMSSMT", IsaraObjectIdentifiers.id_alg_xmssmt);
algorithms.put("XMSSMT-SHA256", BCObjectIdentifiers.xmss_mt_SHA256);
algorithms.put("XMSSMT-SHA512", BCObjectIdentifiers.xmss_mt_SHA512);
algorithms.put("XMSSMT-SHAKE128", BCObjectIdentifiers.xmss_mt_SHAKE128);
algorithms.put("XMSSMT-SHAKE256", BCObjectIdentifiers.xmss_mt_SHAKE256);

algorithms.put("QTESLA-P-I", BCObjectIdentifiers.qTESLA_p_I);
algorithms.put("QTESLA-P-III", BCObjectIdentifiers.qTESLA_p_III);
Expand Down
4 changes: 2 additions & 2 deletions pkix/src/test/java/org/bouncycastle/cert/test/CertTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3179,7 +3179,7 @@ public void checkCreation8()
//
// create the certificate - version 3
//
ContentSigner sigGen = new JcaContentSignerBuilder("XMSS-SHA256").setProvider("BCPQC").build(privKey);
ContentSigner sigGen = new JcaContentSignerBuilder("XMSS").setProvider("BCPQC").build(privKey);
X509v3CertificateBuilder certGen = new JcaX509v3CertificateBuilder(builder.build(), BigInteger.valueOf(((XMSSPrivateKey)privKey).getIndex()), new Date(System.currentTimeMillis() - 50000), new Date(System.currentTimeMillis() + 50000), builder.build(), pubKey);

X509Certificate cert = new JcaX509CertificateConverter().setProvider(BC).getCertificate(certGen.build(sigGen));
Expand Down Expand Up @@ -3230,7 +3230,7 @@ public void checkCreation9()
//
// create the certificate - version 3
//
ContentSigner sigGen = new JcaContentSignerBuilder("XMSSMT-SHAKE256").setProvider("BCPQC").build(privKey);
ContentSigner sigGen = new JcaContentSignerBuilder("XMSSMT").setProvider("BCPQC").build(privKey);
X509v3CertificateBuilder certGen = new JcaX509v3CertificateBuilder(builder.build(), BigInteger.valueOf(1), new Date(System.currentTimeMillis() - 50000), new Date(System.currentTimeMillis() + 50000), builder.build(), pubKey);

X509Certificate cert = new JcaX509CertificateConverter().setProvider(BC).getCertificate(certGen.build(sigGen));
Expand Down

0 comments on commit 02e2488

Please sign in to comment.