diff --git a/lib/Crypto/Cipher/_mode_ccm.py b/lib/Crypto/Cipher/_mode_ccm.py index e4ffd0d5..c224b27d 100644 --- a/lib/Crypto/Cipher/_mode_ccm.py +++ b/lib/Crypto/Cipher/_mode_ccm.py @@ -353,7 +353,7 @@ def encrypt(self, plaintext, output=None): # No more associated data allowed from now if self._assoc_len is None: assert(isinstance(self._cache, list)) - self._assoc_len = sum([len(x) for x in self._cache]) + self._assoc_len = sum(len(x) for x in self._cache) if self._msg_len is not None: self._start_mac() else: @@ -432,7 +432,7 @@ def decrypt(self, ciphertext, output=None): # No more associated data allowed from now if self._assoc_len is None: assert(isinstance(self._cache, list)) - self._assoc_len = sum([len(x) for x in self._cache]) + self._assoc_len = sum(len(x) for x in self._cache) if self._msg_len is not None: self._start_mac() else: @@ -494,7 +494,7 @@ def _digest(self): if self._assoc_len is None: assert(isinstance(self._cache, list)) - self._assoc_len = sum([len(x) for x in self._cache]) + self._assoc_len = sum(len(x) for x in self._cache) if self._msg_len is not None: self._start_mac() else: