Skip to content

Commit

Permalink
Merge pull request #4 from GuilhemN/GuilhemN-patch-1
Browse files Browse the repository at this point in the history
Fix field variable in NTT constants generation
  • Loading branch information
tprest authored Sep 28, 2024
2 parents 88d01ed + fccde31 commit bc443f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ntt.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def intt(f_ntt):
elif (n == 2):
f = [0] * n
f[0] = (i2 * (f_ntt[0] + f_ntt[1])) % q
f[1] = (i2 * inv_mod_q[1479] * (f_ntt[0] - f_ntt[1])) % q
f[1] = (i2 * inv_mod_q[sqr1] * (f_ntt[0] - f_ntt[1])) % q
return f


Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_constants.sage
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ phi2048_roots = sum([[sqrt(elt), - sqrt(elt)] for elt in phi1024_roots], [])
for q = 12 * 1024 + 1 and n = 4, 8, 16, ..., 1024."""
q = 12 * 1024 + 1
Zq = Integers(q)
phi4_roots_Zq = [sqrt(R(- 1)), - sqrt(R(- 1))]
phi4_roots_Zq = [sqrt(Zq(- 1)), - sqrt(Zq(- 1))]
phi8_roots_Zq = sum([[sqrt(elt), - sqrt(elt)] for elt in phi4_roots_Zq], [])
phi16_roots_Zq = sum([[sqrt(elt), - sqrt(elt)] for elt in phi8_roots_Zq], [])
phi32_roots_Zq = sum([[sqrt(elt), - sqrt(elt)] for elt in phi16_roots_Zq], [])
Expand Down

0 comments on commit bc443f7

Please sign in to comment.