Skip to content

Commit 2c68875

Browse files
committed
perf: ⚡️ speed up decrypt_key
1 parent a071ad1 commit 2c68875

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyencrypt/decrypt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
from pathlib import Path
21
import os
2+
from functools import lru_cache
3+
from pathlib import Path
4+
35
from pyencrypt.aes import aes_decrypt
46
from pyencrypt.ntt import intt
57

68

9+
@lru_cache(maxsize=None)
710
def decrypt_key(cipher_key: str, d: int, n: int) -> str:
811
plain_ls = list()
912
for num in map(int, cipher_key.split("O")):

0 commit comments

Comments
 (0)