Exclude AES CTR from block size check
parent
1c242652a7
commit
e65ce4288a
|
@ -181,7 +181,7 @@ class _Cipher(object):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"empty string not allowed")
|
"empty string not allowed")
|
||||||
|
|
||||||
if len(string) % self.block_size and not "ChaCha" in self._native_type:
|
if len(string) % self.block_size and not self.mode == MODE_CTR and not "ChaCha" in self._native_type:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"string must be a multiple of %d in length" % self.block_size)
|
"string must be a multiple of %d in length" % self.block_size)
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ class _Cipher(object):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"empty string not allowed")
|
"empty string not allowed")
|
||||||
|
|
||||||
if len(string) % self.block_size and not "ChaCha" in self._native_type:
|
if len(string) % self.block_size and not self.mode == MODE_CTR and not "ChaCha" in self._native_type:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"string must be a multiple of %d in length" % self.block_size)
|
"string must be a multiple of %d in length" % self.block_size)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue