DH.pyi 705 B

12345678910111213141516171819
  1. from typing import TypedDict, Callable, TypeVar, Generic
  2. from typing_extensions import Unpack, NotRequired
  3. from Crypto.PublicKey.ECC import EccKey
  4. T = TypeVar('T')
  5. class RequestParams(TypedDict, Generic[T]):
  6. kdf: Callable[[bytes|bytearray|memoryview], T]
  7. static_priv: NotRequired[EccKey]
  8. static_pub: NotRequired[EccKey]
  9. eph_priv: NotRequired[EccKey]
  10. eph_pub: NotRequired[EccKey]
  11. def import_x25519_public_key(encoded: bytes) -> EccKey: ...
  12. def import_x25519_private_key(encoded: bytes) -> EccKey: ...
  13. def import_x448_public_key(encoded: bytes) -> EccKey: ...
  14. def import_x448_private_key(encoded: bytes) -> EccKey: ...
  15. def key_agreement(**kwargs: Unpack[RequestParams[T]]) -> T: ...