Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

Commit

Permalink
Use fast unpadder by default
Browse files Browse the repository at this point in the history
  • Loading branch information
xymy committed Mar 23, 2020
1 parent 0487afb commit f1ffa2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/xycrypto/padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,12 @@ def finalize(self):
def wrap_encryptor(self, encryptor_ctx):
return self._PaddingWrapper(encryptor_ctx, self.padder())

def wrap_decryptor(self, decryptor_ctx):
return self._PaddingWrapper(self.unpadder(), decryptor_ctx)
def wrap_decryptor(self, decryptor_ctx, *, fast=True):
if fast:
unpadder = self.fast_unpadder()
else:
unpadder = self.unpadder()
return self._PaddingWrapper(unpadder, decryptor_ctx)


# ==============
Expand Down

0 comments on commit f1ffa2d

Please sign in to comment.