File 1613-public_key-Add-ML-DSA-and-SSL-DSA-to-generate_key.patch of Package erlang

From 935092c223c26b165e19ecd52dcfa49a82b4ed20 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin <ingela@erlang.org>
Date: Tue, 18 Nov 2025 19:24:29 +0100
Subject: [PATCH 3/5] public_key: Add ML-DSA and SSL-DSA to generate_key

---
 lib/public_key/src/public_key.erl | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index 255d761a67..e1faa65430 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -1304,8 +1304,8 @@ included in the private key structure. See also `crypto:generate_key/2`
 """.
 -doc(#{group => <<"Key API">>,
        since => <<"OTP R16B01">>}).
--spec generate_key(DHparams | ECparams | RSAparams) ->
-                          DHkeys | ECkey | RSAkey
+-spec generate_key(DHparams | ECparams | RSAparams | MLDSA | SLHDSA) ->
+                          DHkeys | ECkey | RSAkey | MLDSAKeys | SLHDSAKeys
                               when DHparams :: #'DHParameter'{},
                                    DHkeys :: {PublicDH::binary(), PrivateDH::binary()},
                                    ECparams :: {namedCurve, oid() | atom()} | #'ECParameters'{},
@@ -1313,7 +1313,11 @@ included in the private key structure. See also `crypto:generate_key/2`
                                    RSAparams :: {rsa, Size, PubExp},
                                    Size::pos_integer(),
                                    PubExp::pos_integer(),
-                                   RSAkey :: #'RSAPrivateKey'{} .
+                                   RSAkey :: #'RSAPrivateKey'{},
+                                   MLDSA :: crypto:mldsa(),
+                                   MLDSAKeys ::{#'ML-DSAPublicKey'{}, #'ML-DSAPrivateKey'{}},
+                                   SLHDSA :: crypto:slh_dsa(),
+                                   SLHDSAKeys :: {#'SLH-DSAPublicKey'{}, #'SLH-DSAPrivateKey'{}}.
 
 generate_key(#'DHParameter'{prime = P, base = G}) ->
     crypto:generate_key(dh, [P, G]);
-- 
2.51.0

openSUSE Build Service is sponsored by