Mentions légales du service

Skip to content
Snippets Groups Projects
Commit f7570f56 authored by GUILLEVIC Aurore's avatar GUILLEVIC Aurore
Browse files

Fotiadis Martindale curve which is FST 6.7 k=12 D=2, for Jolijn Cottaar

parent 0c2220c5
No related branches found
No related tags found
No related merge requests found
......@@ -26,12 +26,18 @@ from tnfs.curve.pairing_friendly_curve import get_curve_parameter_a_j1728, get_c
from tnfs.curve.pairing_friendly_curve import compute_beta_lambda
from tnfs.curve.pairing_friendly_curve import BrezingWeng
allowed_code = [1, 10, 17, 19, 20, 23, 24, 25, 26, 27, 28, 29]
"""
Curves from ePrint 2019/555
Also from 2018/969
"""
allowed_code = [1, 10, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29]
def polynomial_params_from_code(code):
QQx = QQ['x']; (x,) = QQx._first_ngens(1)
if code == 1:
# this is also Family 1 in ePrint 2018/969
k=8
D=1
m=2
......@@ -84,6 +90,24 @@ def polynomial_params_from_code(code):
betax = 4320*x**5 + 3672*x**4 + 2430*x**3 + 954*x**2 + 237*x + 46
lambx = 36*x**3 + 18*x**2 + 6*x + 1
elif code == 18:
# this is also Family 8 in ePrint 2018/969
# and this is FST 6.7 with k=12
k=12
D=2
m=2
u_mod_m = [1]
zeta_k_mod_rx = x**2
exp_tr = 1
rx = x**8 - x**4 + 1 # Phi_24(x)
tx = x**2 + 1
yx = (x**7 - 2*x**3 + x)/2
px = (x**14 - 4*x**10 + 2*x**8 + 4*x**6 - 2*x**4 + 5*x**2 + 2)/8
cx = (x**6 - 3*x**2 + 2)/8
cx == (x**2 - 1)**2 * (x**2 + 2)
betax = (x**13 - x**11 - 3*x**9 + 5*x**7 + x**5 - 3*x**3 + 4*x)/2
lambx = x**5 + x**3 - x
elif code == 19:
k=12
D=3
......@@ -274,6 +298,9 @@ def polynomial_params_from_code(code):
elif D==1:
assert ((betax**2 + 1) % px) == 0
assert ((lambx**2 + 1) % rx) == 0
elif D==2:
assert ((betax**2 + 2) % px) == 0
assert ((lambx**2 + 2) % rx) == 0
return px, rx, tx, cx, yx, betax, lambx, D, k, m, u_mod_m
......
......@@ -65,6 +65,7 @@ from tnfs.curve.pairing_friendly_curve import compute_a_b
# sage -python -m tnfs.gen.generate_sparse_curve --auri -k 20 -D 1 -a 2 -e0 9 -r 380 384 -w 4 --find_all_w_up_to --2NAF
#
# sage -python -m tnfs.gen.generate_sparse_curve --fm -code 17 -p 384 384 -w 5 --find_all_w_up_to --2NAF
# sage -python -m tnfs.gen.generate_sparse_curve --fm -code 18 -r 249 256 -w 5 --find_all_w_up_to --2NAF
# sage -python -m tnfs.gen.generate_sparse_curve --fm -code 23 -r 384 384 -w 5 --find_all_w_up_to --2NAF
# sage -python -m tnfs.gen.generate_sparse_curve --fm -code 25 -r 384 384 -w 5 --find_all_w_up_to --2NAF
# sage -python -m tnfs.gen.generate_sparse_curve --fm -code 27 -r 384 384 -w 5 --find_all_w_up_to --2NAF
......@@ -651,6 +652,8 @@ for u_nbits in range(u_nbits_min, u_nbits_max+1):
E = curve(k=k, u=u, D=D, e0=e0, aa=a_auri, a=a, b=b)
elif curve == Cyclotomic:
E = curve(k=k, u=u, D=D, l=l, e0=e0, a=a, b=b)
elif curve == FotiadisMartindale:
E = curve(code=code, u=u, a=a, b=b)
else:
E = curve(k=k, u=u, a=a, b=b)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment