diff --git a/stubs/paramiko/METADATA.toml b/stubs/paramiko/METADATA.toml index 3cde7708908c..452714e2f143 100644 --- a/stubs/paramiko/METADATA.toml +++ b/stubs/paramiko/METADATA.toml @@ -1,7 +1,7 @@ -version = "5.0.*" +version = "5.1.*" upstream-repository = "https://github.com/paramiko/paramiko" -# Requires a version of cryptography where cryptography.hazmat.primitives.ciphers.Cipher is generic -dependencies = ["cryptography>=37.0.0"] +# Requires a version of cryptography with cryptography.hazmat.primitives.asymmetric.mlkem +dependencies = ["cryptography>=47.0.0"] [tool.stubtest] # linux and darwin are equivalent diff --git a/stubs/paramiko/paramiko/kex_mlkem.pyi b/stubs/paramiko/paramiko/kex_mlkem.pyi new file mode 100644 index 000000000000..060236e06a32 --- /dev/null +++ b/stubs/paramiko/paramiko/kex_mlkem.pyi @@ -0,0 +1,24 @@ +from _typeshed import ReadableBuffer +from collections.abc import Callable +from hashlib import _Hash +from typing import ClassVar, Final + +from cryptography.hazmat.primitives.asymmetric.mlkem import MLKEM768PrivateKey +from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey +from paramiko.message import Message +from paramiko.transport import Transport + +c_MSG_KEX_HYBRID_INIT: Final = b"\x1e" +c_MSG_KEX_HYBRID_REPLY: Final = b"\x1f" + +class KexMLKEM768X25519: + name: Final = "mlkem768x25519-sha256" + hash_algo: ClassVar[Callable[[ReadableBuffer], _Hash]] + transport: Transport + mlkem_key: MLKEM768PrivateKey | None + x25519_key: X25519PrivateKey | None + def __init__(self, transport: Transport) -> None: ... + @classmethod + def is_available(cls) -> bool: ... + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ...