File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ def encrypt(self, string):
181181 raise ValueError (
182182 "empty string not allowed" )
183183
184- if len (string ) % self .block_size and not "ChaCha" in self ._native_type :
184+ if len (string ) % self .block_size and not self . mode == MODE_CTR and not "ChaCha" in self ._native_type :
185185 raise ValueError (
186186 "string must be a multiple of %d in length" % self .block_size )
187187
@@ -214,7 +214,7 @@ def decrypt(self, string):
214214 raise ValueError (
215215 "empty string not allowed" )
216216
217- if len (string ) % self .block_size and not "ChaCha" in self ._native_type :
217+ if len (string ) % self .block_size and not self . mode == MODE_CTR and not "ChaCha" in self ._native_type :
218218 raise ValueError (
219219 "string must be a multiple of %d in length" % self .block_size )
220220
You can’t perform that action at this time.
0 commit comments