Commit 107d4125 authored by Emmanuel Thomé's avatar Emmanuel Thomé

reconcile normalisation choices between CocksPinchVariant.py and final_expo_k68.sage

parent e0c4b808
......@@ -535,6 +535,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 +978,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]
......@@ -1340,12 +1344,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
......
......@@ -167,11 +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,0xffc00020fffffffc,1,ht=1,hy=-0xdc04,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)
......
This diff is collapsed.
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