Skip to content

Commit

Permalink
AES compression: enlarge buffer size
Browse files Browse the repository at this point in the history
* Set buffer size to READ_BLOCKSIZE + CBC_BLOCKSIZE * 2
* Try to fix #201

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
  • Loading branch information
miurahr committed Jul 26, 2020
1 parent 492b925 commit abc96ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py7zr/compressor.py
Expand Up @@ -76,7 +76,7 @@ def __init__(self, password: str) -> None:
self.iv += bytes(self.AES_CBC_BLOCKSIZE - len(self.iv)) # zero padding if iv < AES_CBC_BLOCKSIZE
self.cipher = AES.new(key, AES.MODE_CBC, self.iv)
self.flushed = False
self.buf = Buffer(size=READ_BLOCKSIZE + self.AES_CBC_BLOCKSIZE)
self.buf = Buffer(size=READ_BLOCKSIZE + self.AES_CBC_BLOCKSIZE * 2)

def encode_filter_properties(self):
# cycles = secrets.SystemRandom().randint(1, 23)
Expand Down

0 comments on commit abc96ec

Please sign in to comment.