From dc928a1fba1a857430485940dd6395ea22958961 Mon Sep 17 00:00:00 2001 From: Qi Zhao Date: Tue, 5 Nov 2024 18:05:38 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E2=9A=A1=EF=B8=8F=20speed=20up=20decry?= =?UTF-8?q?pt=5Fkey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyencrypt/decrypt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyencrypt/decrypt.py b/pyencrypt/decrypt.py index 140fd77..37da803 100644 --- a/pyencrypt/decrypt.py +++ b/pyencrypt/decrypt.py @@ -1,9 +1,12 @@ -from pathlib import Path import os +from functools import lru_cache +from pathlib import Path + from pyencrypt.aes import aes_decrypt from pyencrypt.ntt import intt +@lru_cache def decrypt_key(cipher_key: str, d: int, n: int) -> str: plain_ls = list() for num in map(int, cipher_key.split("O")):