File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
main/java/org/bouncycastle/operator
test/java/org/bouncycastle/cms/test Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,9 @@ public class DefaultDigestAlgorithmIdentifierFinder
161161 digestOids .put (NISTObjectIdentifiers .id_hash_slh_dsa_shake_256s_with_shake256 , NISTObjectIdentifiers .id_shake256 );
162162 digestOids .put (NISTObjectIdentifiers .id_hash_slh_dsa_shake_256f_with_shake256 , NISTObjectIdentifiers .id_shake256 );
163163
164- digestOids .put (NISTObjectIdentifiers .id_ml_dsa_44 , NISTObjectIdentifiers .id_shake256 );
165- digestOids .put (NISTObjectIdentifiers .id_ml_dsa_65 , NISTObjectIdentifiers .id_shake256 );
166- digestOids .put (NISTObjectIdentifiers .id_ml_dsa_87 , NISTObjectIdentifiers .id_shake256 );
164+ digestOids .put (NISTObjectIdentifiers .id_ml_dsa_44 , NISTObjectIdentifiers .id_sha512 );
165+ digestOids .put (NISTObjectIdentifiers .id_ml_dsa_65 , NISTObjectIdentifiers .id_sha512 );
166+ digestOids .put (NISTObjectIdentifiers .id_ml_dsa_87 , NISTObjectIdentifiers .id_sha512 );
167167 digestOids .put (NISTObjectIdentifiers .id_hash_ml_dsa_44_with_sha512 , NISTObjectIdentifiers .id_sha512 );
168168 digestOids .put (NISTObjectIdentifiers .id_hash_ml_dsa_65_with_sha512 , NISTObjectIdentifiers .id_sha512 );
169169 digestOids .put (NISTObjectIdentifiers .id_hash_ml_dsa_87_with_sha512 , NISTObjectIdentifiers .id_sha512 );
Original file line number Diff line number Diff line change @@ -586,6 +586,11 @@ public void testMLDSAEncapsulated()
586586
587587 CMSSignedData s = gen .generate (msg , true );
588588
589+ AlgorithmIdentifier digestAlgorithmID = s .getSignerInfos ().getSigners ().iterator ().next ().getDigestAlgorithmID ();
590+ // CNSA compliance requires SHA-384 or SHA-512. We now default to SHA-512
591+ assertEquals (NISTObjectIdentifiers .id_sha512 , digestAlgorithmID .getAlgorithm ());
592+ assertNull (digestAlgorithmID .getParameters ());
593+
589594 checkSignature (s , gen );
590595 }
591596
You can’t perform that action at this time.
0 commit comments