DH.pyi 467 B

123456789101112131415
  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 key_agreement(**kwargs: Unpack[RequestParams[T]]) -> T: ...