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