Skip to content

Commit 630af97

Browse files
committed
public_key: Add ML-DSA and SSL-DSA to generate_key
1 parent 5a323e2 commit 630af97

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/public_key/src/public_key.erl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,16 +1311,20 @@ included in the private key structure. See also `crypto:generate_key/2`
13111311
""".
13121312
-doc(#{group => <<"Key API">>,
13131313
since => <<"OTP R16B01">>}).
1314-
-spec generate_key(DHparams | ECparams | RSAparams) ->
1315-
DHkeys | ECkey | RSAkey
1314+
-spec generate_key(DHparams | ECparams | RSAparams | MLDSA | SLHDSA) ->
1315+
DHkeys | ECkey | RSAkey | MLDSAKeys | SLHDSAKeys
13161316
when DHparams :: #'DHParameter'{},
13171317
DHkeys :: {PublicDH::binary(), PrivateDH::binary()},
13181318
ECparams :: {namedCurve, oid() | atom()} | #'ECParameters'{},
13191319
ECkey :: #'ECPrivateKey'{},
13201320
RSAparams :: {rsa, Size, PubExp},
13211321
Size::pos_integer(),
13221322
PubExp::pos_integer(),
1323-
RSAkey :: #'RSAPrivateKey'{} .
1323+
RSAkey :: #'RSAPrivateKey'{},
1324+
MLDSA :: crypto:mldsa(),
1325+
MLDSAKeys ::{#'ML-DSAPublicKey'{}, #'ML-DSAPrivateKey'{}},
1326+
SLHDSA :: crypto:slh_dsa(),
1327+
SLHDSAKeys :: {#'SLH-DSAPublicKey'{}, #'SLH-DSAPrivateKey'{}}.
13241328

13251329
generate_key(#'DHParameter'{prime = P, base = G}) ->
13261330
crypto:generate_key(dh, [P, G]);

0 commit comments

Comments
 (0)