File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ def encrypt(self, string):
183183 raise ValueError (
184184 "empty string not allowed" )
185185
186- if len (string ) % self .block_size and not self . mode == MODE_CTR and not "ChaCha" in self ._native_type :
186+ if len (string ) % self .block_size and "ChaCha" not in self ._native_type and self . mode != MODE_CTR :
187187 raise ValueError (
188188 "string must be a multiple of %d in length" % self .block_size )
189189
@@ -215,7 +215,7 @@ def decrypt(self, string):
215215 if not string :
216216 raise ValueError ("empty string not allowed" )
217217
218- if len (string ) % self .block_size and self . mode != MODE_CTR and "ChaCha" not in self ._native_type :
218+ if len (string ) % self .block_size and "ChaCha" not in self ._native_type and self . mode != MODE_CTR :
219219 raise ValueError (
220220 "string must be a multiple of %d in length" % self .block_size )
221221
You can’t perform that action at this time.
0 commit comments