Skip to content

Commit

Permalink
fix: support both cryptodome namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Kornitzer committed Jan 24, 2025
1 parent 96075ef commit c364aba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ source = "vcs"

[[tool.mypy.overrides]]
module = [
"Cryptodome.*",
"olefile.*",
"pytest.*",
]
Expand Down
5 changes: 4 additions & 1 deletion src/hwp_extract/encrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

import hashlib

from Crypto.Cipher import AES
try:
from Cryptodome.Cipher import AES
except ModuleNotFoundError:
from Crypto.Cipher import AES


def pad(s: bytes) -> bytes:
Expand Down

0 comments on commit c364aba

Please sign in to comment.