File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 2
2
import base64
3
3
import urllib .parse
4
4
5
- from typing import Union
5
+ from typing import Union , Callable
6
6
from concurrent .futures import ThreadPoolExecutor
7
7
8
8
@@ -53,16 +53,16 @@ def remove_padding(data: Union[str, bytes]):
53
53
54
54
55
55
56
- def _dummy_oracle (cipher ) :
56
+ def _dummy_oracle (cipher : bytes ) -> bool :
57
57
raise NotImplementedError ('You must implement the oracle function' )
58
58
59
59
60
- def padding_oracle (cipher ,
61
- block_size ,
62
- oracle = _dummy_oracle ,
63
- num_threads = 1 ,
64
- log_level = logging .INFO ,
65
- null = b' ' ):
60
+ def padding_oracle (cipher : bytes ,
61
+ block_size : int ,
62
+ oracle : Callable [[ bytes ], bool ] = _dummy_oracle ,
63
+ num_threads : int = 1 ,
64
+ log_level : int = logging .INFO ,
65
+ null : bytes = b' ' ) -> bytes :
66
66
# Check the oracle function
67
67
assert callable (oracle ), 'the oracle function should be callable'
68
68
assert oracle .__code__ .co_argcount == 1 , 'expect oracle function with only 1 argument'
You can’t perform that action at this time.
0 commit comments