diff --git a/src/shamira/fft.py b/src/shamira/fft.py --- a/src/shamira/fft.py +++ b/src/shamira/fft.py @@ -1,6 +1,7 @@ import math import cmath import itertools +from functools import cache from .gf256 import gfmul, gfpow @@ -20,6 +21,7 @@ def ceil_size(n): return ni +@cache def precompute_x(n): """Return a geometric sequence [1, w, w**2, ..., w**(n-1)], where w**n==1. This can be done only for certain values of n."""