Commit 8bb205a9 authored by MASSON Simon's avatar MASSON Simon

solve conflicts

parents cfc507a7 107d4125
......@@ -506,6 +506,9 @@ class CocksPinchVariantResult(object):
"""
def __init__(self,k,D,T,i,ht=Integer(0),hy=Integer(0),max_poly_coeff=None,pre=False,l=1, allowed_cofactor = 1, allowed_size_cofactor = 5, max_trialdiv=10**6, max_B1=10**4, new_semantics=False):
=======
def __init__(self,k,D,T,i,ht=Integer(0),hy=Integer(0),max_poly_coeff=0,pre=False,l=1, allowed_cofactor = 1, allowed_size_cofactor = 5, max_trialdiv=10**6, max_B1=10**4, new_semantics=False):
>>>>>>> 107d412592d84ec5619ec671ff8231cbcde4d52c
kl = k * l
fD = -fundamental_discriminant(-D)
......@@ -535,6 +538,7 @@ class CocksPinchVariantResult(object):
self.t0 -= r
if abs(r-self.y0) < abs(self.y0):
self.y0 -= r
self.y0 = abs(self.y0)
# Determination of the lifted (t,y) from the solution mod r
......@@ -977,7 +981,10 @@ class CocksPinchVariantResult(object):
saved_max_B1 = self.max_B1
self.max_B1 = 600
dt0 = t0 - ((T**i+1) % r)
dy0 = y0 - ZZ((t0-2)/sqrt(Integers(r)(-fD)))
y0base = ZZ((t0-2)/sqrt(Integers(r)(-fD)))
if r - y0base < y0base:
y0base = r - y0base
dy0 = y0 - y0base
assert dt0 in [0,-r]
assert dy0 in [0,-r]
......@@ -1035,7 +1042,7 @@ class CocksPinchVariantSearch(object):
output_file="",
T_choice="",
hty_choice="",
max_poly_coeff=None,
max_poly_coeff=0,
l=1,
required_cofactor=1,
allowed_cofactor = 1,
......@@ -1084,7 +1091,7 @@ class CocksPinchVariantSearch(object):
self.T_choice = T_choice
self.hty_choice = hty_choice
self.l = l
self.max_poly_coeff = max_poly_coeff
self.max_poly_coeff = Integer(max_poly_coeff)
self.required_cofactor = Integer(required_cofactor)
self.allowed_cofactor = Integer(allowed_cofactor)
self.allowed_size_cofactor = Integer(allowed_size_cofactor)
......@@ -1340,12 +1347,22 @@ class CocksPinchVariantSearch(object):
y0 = K(t0-2)/sqrt(K(-fD))
# Lift arbitrarily. Anyway we'll iterate over multiple
# possible representatives.
# The normalisation choice that we do in final_expo_k68
# (at least) is that we use the least positive integer
# representative of y0=\pm(t0-2)*inv_sqrt_D
#
# (as for t0, we have no sign indetermination, so we
# simply choose the representative of smallest absolute
# value, and that may mean a negative integer)
t0 = ZZ(t0)
y0 = ZZ(y0)
if abs(r-t0) < abs(t0):
t0 -= r
if abs(r-y0) < abs(y0):
y0 -= r
y0 = abs(y0)
# We want to constrain the bit length of t^2+fD*y^2{{{
# with t = t0 + ht * r and y = y0 + hy * r
......@@ -1931,9 +1948,9 @@ class CocksPinchVariantSearch(object):
fail['p milrab'] += 1
continue
if max_poly_coeff != None :
if self.max_poly_coeff > 0 :
boo = False
for alpha in range(1, max_poly_coeff):
for alpha in range(1, self.max_poly_coeff):
if (x**k - alpha).is_irreducible() :
boo = True
break
......
......@@ -167,10 +167,11 @@ def Hw(x) :
return len(bit_positions_2naf(x))
proof.arithmetic(False)
C5=CocksPinchVariantResult(5,10000000147,0xe000000000008000,1,ht=3,hy=-0x11e36418c7c8b454,max_B1=600)
C5=CocksPinchVariantResult(5,10000000147,0xe000000000008000,1,ht=3,hy=0x11e36418c7c8b454,max_B1=600)
C6=CocksPinchVariantResult(6,3,0xefffffffffffffe00000000000000000,1,ht=-1,hy=0xffbbffffffffffffc020,allowed_cofactor=420,allowed_size_cofactor=10,max_B1=600)
C7=CocksPinchVariantResult(7,20,0x5fffb820248,6,ht=-2,allowed_cofactor=1232,allowed_size_cofactor=10,max_B1=600)
C8=CocksPinchVariantResult(8,4,0xffffffffeff7c200,5,ht=5,hy=-0xd700,allowed_cofactor=420,allowed_size_cofactor=10,max_B1=600)
#C8=CocksPinchVariantResult(8,4,0xffffffffeff7c200,5,ht=5,hy=-0xd700,allowed_cofactor=420,allowed_size_cofactor=10,max_B1=600)
C8=CocksPinchVariantResult(8,4,0xffc00020fffffffc,1,ht=1,hy=0xdc04,allowed_cofactor=420,allowed_size_cofactor=10,max_B1=600)
CMNT6=MNT6(u=873723667900031396506414143162332159382674816702805606206979732381600254701804231398281169537138620,a=209307816050232262803672282154940341360062431838092388077917610639183322072827259682607127795420474686833003315766797546568469776750651773087882545447646552119008299040167030969895802846139484415144,b=2319663192174958547181026340141410918530227127674793888869119262391240421488942353013995765010333162065568990954578077256489549792305772041454141172011940607053889955897003759289947924385489341215143,D=8317003,c=1)
......@@ -509,6 +510,9 @@ def finalExpoCost(C):
c_exp_T = (logT-1)*cyclo_s8 + (HwT-1)*cost_m(k)
# first, this: (because phi_8(p)/r = 1 + c(T^2+p^2)(p-T))
# recall that a p^2-power cost is the same as a p-power
# for the reason explained in remark \ref{frob}.
# What happen if i != 1 when the expo is to the power T^i ?
c2 = 3*c_exp_T + 2*cost_f(8) + 3*cost_m(k)
# Then, see code/formules-familles-CocksPinch.sage
......@@ -524,6 +528,7 @@ def finalExpoCost(C):
c_exp_hu = (loghu-1)*cyclo_s8 + (Hwhu-1)*cost_m(k)
c2 += 4 * c_exp_T + 2 * c_exp_hu + 2 * c_exp_hy + 10 * cost_m(k)
# Do we miss some inversions ?
if (T%4 == 2 or i == 1 or i == 5):
c2 += cost_m(k)
......
This diff is collapsed.
......@@ -53,7 +53,7 @@ while args:
parsed_one = True
search_args[passthrough] = False
args=args[1:]
for passthrough in [ "k", "lambdap", "lambdar", "allowed_automatic_cofactor", "allowed_cofactor", "allowed_size_cofactor", "check_small_subgroup_secure", "required_cofactor", "restrict_i", "Drange", "l", "seed" ]:
for passthrough in [ "k", "lambdap", "lambdar", "allowed_automatic_cofactor", "allowed_cofactor", "allowed_size_cofactor", "check_small_subgroup_secure", "max_poly_coeff", "required_cofactor", "restrict_i", "Drange", "l", "seed" ]:
if not args:
break
if args[0] == "-D" or args[0] == "--D":
......
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