Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions triplesec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def encrypt_ascii(self, data, key=None, v=None, extra_bytes=0,
"hqx": binascii.b2a_hqx}
digestor = digests.get(digest)
if not digestor:
TripleSecError(u"Digestor not supported.")
raise TripleSecError(u"Digestor not supported.")

binary_result = self.encrypt(data, key, v, extra_bytes)
result = digestor(binary_result)
Expand Down Expand Up @@ -180,7 +180,7 @@ def decrypt_ascii(self, ascii_string, key=None, digest="hex"):
"hqx": binascii.a2b_hqx}
digestor = digests.get(digest)
if not digestor:
TripleSecError(u"Digestor not supported.")
raise TripleSecError(u"Digestor not supported.")

binary_string = digestor(ascii_string)
result = self.decrypt(binary_string, key)
Expand Down