From 4e2023626993fc70df709d79b8a05f2761a413f2 Mon Sep 17 00:00:00 2001 From: David Hook Date: Sun, 1 Sep 2024 08:29:00 +1000 Subject: [PATCH] added aliases SHA512withMLDSA, HASHwithSLHDSA, MLDSA, SLHDSA. --- .../bouncycastle/jcajce/provider/asymmetric/MLDSA.java | 10 ++-------- .../jcajce/provider/asymmetric/SLHDSA.java | 2 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/MLDSA.java b/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/MLDSA.java index 37fb0b4b5b..2c6f9c3cc6 100644 --- a/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/MLDSA.java +++ b/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/MLDSA.java @@ -43,20 +43,14 @@ public void configure(ConfigurableProvider provider) addSignatureAlgorithm(provider, "ML-DSA-44", PREFIX + "SignatureSpi$MLDSA44", NISTObjectIdentifiers.id_ml_dsa_44); addSignatureAlgorithm(provider, "ML-DSA-65", PREFIX + "SignatureSpi$MLDSA65", NISTObjectIdentifiers.id_ml_dsa_65); addSignatureAlgorithm(provider, "ML-DSA-87", PREFIX + "SignatureSpi$MLDSA87", NISTObjectIdentifiers.id_ml_dsa_87); + provider.addAlgorithm("Alg.Alias.Signature.MLDSA", "ML-DSA"); addSignatureAlgorithm(provider, "HASH-ML-DSA", PREFIX + "HashSignatureSpi$MLDSA", (ASN1ObjectIdentifier)null); addSignatureAlgorithm(provider, "ML-DSA-44-WITH-SHA512", PREFIX + "HashSignatureSpi$MLDSA44", NISTObjectIdentifiers.id_hash_ml_dsa_44_with_sha512); addSignatureAlgorithm(provider, "ML-DSA-65-WITH-SHA512", PREFIX + "HashSignatureSpi$MLDSA65", NISTObjectIdentifiers.id_hash_ml_dsa_65_with_sha512); addSignatureAlgorithm(provider, "ML-DSA-87-WITH-SHA512", PREFIX + "HashSignatureSpi$MLDSA87", NISTObjectIdentifiers.id_hash_ml_dsa_87_with_sha512); -// provider.addAlgorithm("Alg.Alias.Signature." + NISTObjectIdentifiers.id_ml_dsa_44, "ML-DSA"); -// provider.addAlgorithm("Alg.Alias.Signature.OID." + NISTObjectIdentifiers.id_ml_dsa_44, "ML-DSA"); -// -// provider.addAlgorithm("Alg.Alias.Signature." + NISTObjectIdentifiers.id_ml_dsa_65, "ML-DSA"); -// provider.addAlgorithm("Alg.Alias.Signature.OID." + NISTObjectIdentifiers.id_ml_dsa_65, "ML-DSA"); -// -// provider.addAlgorithm("Alg.Alias.Signature." + NISTObjectIdentifiers.id_ml_dsa_87, "ML-DSA"); -// provider.addAlgorithm("Alg.Alias.Signature.OID." + NISTObjectIdentifiers.id_ml_dsa_87, "ML-DSA"); + provider.addAlgorithm("Alg.Alias.Signature.SHA512WITHMLDSA", "HASH-ML-DSA"); AsymmetricKeyInfoConverter keyFact = new MLDSAKeyFactorySpi.Hash(); diff --git a/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/SLHDSA.java b/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/SLHDSA.java index 9b5de0bf3d..a0622bf121 100644 --- a/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/SLHDSA.java +++ b/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/SLHDSA.java @@ -84,7 +84,9 @@ public void configure(ConfigurableProvider provider) addKeyPairGeneratorAlgorithm(provider, "SLH-DSA-SHAKE-256F-WITH-SHAKE256", PREFIX + "SLHDSAKeyPairGeneratorSpi$HashShake_256f", NISTObjectIdentifiers.id_hash_slh_dsa_shake_256f_with_shake256); addSignatureAlgorithm(provider, "SLH-DSA", PREFIX + "SignatureSpi$Direct", (ASN1ObjectIdentifier)null); + provider.addAlgorithm("Alg.Alias.Signature.SLHDSA", "SLH-DSA"); addSignatureAlgorithm(provider, "HASH-SLH-DSA", PREFIX + "HashSignatureSpi$Direct", (ASN1ObjectIdentifier)null); + provider.addAlgorithm("Alg.Alias.Signature.HASHWITHSLHDSA", "HASH-SLH-DSA"); ASN1ObjectIdentifier[] nistOids = new ASN1ObjectIdentifier[] {