Debian Codegraph @

lib/Crypto/Protocol/KDF.pyi

raw symbols SCIP
1 from types import ModuleType
2 from typing import Optional, Callable, Tuple, Union, Dict, Any, overload
3 from typing_extensions import Literal
4
5 Buffer=bytes|bytearray|memoryview
6
7 RNG = Callable[[int], bytes]
8 PRF = Callable[[bytes, bytes], bytes]
9
10 def PBKDF1(password: str, salt: bytes, dkLen: int, count: Optional[int]=1000, hashAlgo: Optional[ModuleType]=None) -> bytes: ...
11 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: ...
12
13 class _S2V(object):
14 def __init__(self, key: bytes, ciphermod: ModuleType, cipher_params: Optional[Dict[Any, Any]]=None) -> None: ...
15
16 @staticmethod
17 def new(key: bytes, ciphermod: ModuleType) -> None: ...
18 def update(self, item: bytes) -> None: ...
19 def derive(self) -> bytes: ...
20
21 def HKDF(master: bytes, key_len: int, salt: bytes, hashmod: ModuleType, num_keys: Optional[int]=1, context: Optional[bytes]=None) -> Union[bytes, Tuple[bytes, ...]]: ...
22
23 def scrypt(password: str, salt: str, key_len: int, N: int, r: int, p: int, num_keys: Optional[int]=1) -> Union[bytes, Tuple[bytes, ...]]: ...
24
25 def _bcrypt_decode(data: bytes) -> bytes: ...
26 def _bcrypt_hash(password:bytes , cost: int, salt: bytes, constant:bytes, invert:bool) -> bytes: ...
27 def bcrypt(password: Union[bytes, str], cost: int, salt: Optional[bytes]=None) -> bytes: ...
28 def bcrypt_check(password: Union[bytes, str], bcrypt_hash: Union[bytes, bytearray, str]) -> None: ...
29
30 @overload
31 def SP800_108_Counter(master: Buffer,
32 key_len: int,
33 prf: PRF,
34 num_keys: Literal[None] = None,
35 label: Buffer = b'', context: Buffer = b'') -> bytes: ...
36
37 @overload
38 def SP800_108_Counter(master: Buffer,
39 key_len: int,
40 prf: PRF,
41 num_keys: int,
42 label: Buffer = b'', context: Buffer = b'') -> Tuple[bytes]: ...