KDF.pyi 1.4 KB

12345678910111213141516171819202122232425
  1. from types import ModuleType
  2. from typing import Optional, Callable, Tuple, Union, Dict, Any
  3. RNG = Callable[[int], bytes]
  4. def PBKDF1(password: str, salt: bytes, dkLen: int, count: Optional[int]=1000, hashAlgo: Optional[ModuleType]=None) -> bytes: ...
  5. def PBKDF2(password: str, salt: bytes, dkLen: Optional[int]=16, count: Optional[int]=1000, prf: Optional[RNG]=None, hmac_hash_module: Optional[ModuleType]=None) -> bytes: ...
  6. class _S2V(object):
  7. def __init__(self, key: bytes, ciphermod: ModuleType, cipher_params: Optional[Dict[Any, Any]]=None) -> None: ...
  8. @staticmethod
  9. def new(key: bytes, ciphermod: ModuleType) -> None: ...
  10. def update(self, item: bytes) -> None: ...
  11. def derive(self) -> bytes: ...
  12. def HKDF(master: bytes, key_len: int, salt: bytes, hashmod: ModuleType, num_keys: Optional[int]=1, context: Optional[bytes]=None) -> Union[bytes, Tuple[bytes, ...]]: ...
  13. def scrypt(password: str, salt: str, key_len: int, N: int, r: int, p: int, num_keys: Optional[int]=1) -> Union[bytes, Tuple[bytes, ...]]: ...
  14. def _bcrypt_decode(data: bytes) -> bytes: ...
  15. def _bcrypt_hash(password:bytes , cost: int, salt: bytes, constant:bytes, invert:bool) -> bytes: ...
  16. def bcrypt(password: Union[bytes, str], cost: int, salt: Optional[bytes]=None) -> bytes: ...
  17. def bcrypt_check(password: Union[bytes, str], bcrypt_hash: Union[bytes, bytearray, str]) -> None: ...