@@ -47,10 +47,10 @@ def padding_oracle(ciphertext: Union[bytes, str],
47
47
wether the ciphertext can be decrypted successfully.
48
48
49
49
Args:
50
- cipher (bytes|str) the cipher you want to decrypt
51
- block_size (int) block size (the cipher length should be
50
+ ciphertext (bytes|str) the ciphertext you want to decrypt
51
+ block_size (int) block size (the ciphertext length should be
52
52
multiple of this)
53
- oracle (function) a function: oracle(cipher : bytes) -> bool
53
+ oracle (function) a function: oracle(ciphertext : bytes) -> bool
54
54
num_threads (int) how many oracle functions will be run in
55
55
parallel (default: 1)
56
56
log_level (int) log level (default: logging.INFO)
@@ -67,11 +67,11 @@ def padding_oracle(ciphertext: Union[bytes, str],
67
67
if not callable (oracle ):
68
68
raise TypeError ('the oracle function should be callable' )
69
69
if not isinstance (ciphertext , (bytes , str )):
70
- raise TypeError ('cipher should have type bytes' )
70
+ raise TypeError ('ciphertext should have type bytes' )
71
71
if not isinstance (block_size , int ):
72
72
raise TypeError ('block_size should have type int' )
73
73
if not len (ciphertext ) % block_size == 0 :
74
- raise ValueError ('cipher length should be multiple of block size' )
74
+ raise ValueError ('ciphertext length should be multiple of block size' )
75
75
if not 1 <= num_threads <= 1000 :
76
76
raise ValueError ('num_threads should be in [1, 1000]' )
77
77
if not isinstance (null_byte , (bytes , str )):
0 commit comments