Commit 2ffd8ae0 authored by GUILLEVIC Aurore's avatar GUILLEVIC Aurore

print parameter y for curves

parent b9d01dbd
......@@ -16,6 +16,21 @@ https://eprint.iacr.org/2019/555.pdf
(for pairing computation estimates)
"""
Rx = [1, 0, 0, 0, 1] # u^4 + 1
Rx_den = 1
Tx= [2, 1, 0, 0, 1]
Tx_den = 1
Px = [4, 4, 1, 0, 5, 0, 1, 0, 1]
Px_den = 4
Yx = [0, 0, -1, 1]
Yx_den = 2
Cx = [0, 0, 1, 0, 1]
Cx_den = 4
BETAx = [-2, -3, 3, -2, 0, -1, 1]
BETAx_den = 4
LAMBx = [0,0,1] # x^2 mod r(x) = x^4+1
LAMBx_den = 1
import sage
from exceptions import ValueError
......
......@@ -178,11 +178,13 @@ def print_parameters(E):
print("p ={: d}".format(E._p))
print("r ={: d}".format(E._r))
print("t ={: d}".format(E._tr))
print("y ={: d}".format(E._y))
print("c ={: d} # cofactor".format(E._c))
print("u ={: #x}".format(E._u))
print("p ={: #x}".format(E._p))
print("r ={: #x}".format(E._r))
print("t ={: #x}".format(E._tr))
print("y ={: #x}".format(E._y))
print("c ={: #x} # cofactor".format(E._c))
print("log_2 p ={0:8.2f}, p {1:5d} bits".format(float(log(E._p,2)), E._p.nbits()))
print("log_2 p^k ={0:8.2f}, p^k {1:5d} bits".format(float(E._k*log(E._p,2)), (E._p**E._k).nbits()))
......
......@@ -12,6 +12,15 @@ twx= 10*x^6 + 32*x^5 + 72*x^4 + 96*x^3 + 87*x^2 + 50*x + 13
beta = 70*x^5 + 184*x^4 + 396*x^3 + 424*x^2 + 341*x + 117
lamb = 4*x^3 + 6*x^2 + 8*x + 3
"""
# do not import with "from TN8 import *" but use "import TN8" and then "TN8.Px"
Rx = [1, 4, 6, 4, 2]
Tx= [2, 4, 2, 2]
Yx = [3, 7, 5, 3]
Px = [10, 46, 85, 94, 72, 32, 10]
Cx = [9, 6, 5]
BETAx = [117, 341, 424, 396, 184, 70]
LAMBx = [3, 8, 6, 4]
import sage
......@@ -38,7 +47,7 @@ class TN8(EllipticCurve_finite_field):
def __init__(self, u, a=None):
"""
u is the seed s.t. p=P(u), r=R(u), t=T(u)
:param u : seed
:param u : seed, should be odd
:param a : curve parameter in E: y^2 = x^3 + a*x (optional)
"""
self._k = 8 # embedding degree
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment