Commit 61c23ae3 authored by GUILLEVIC Aurore's avatar GUILLEVIC Aurore

Merge branch 'master' of gitlab.inria.fr:smasson/cocks-pinch-variant

parents 5775d3c0 458262fe
......@@ -195,11 +195,15 @@ def print_parameters_for_RELIC(E):
# fill at 16 hexa digits, + 2 for the 'prefix '0x' makes 18 characters
print("P{0} {1:0=-#018x}".format(i, pi))
i+=1
g,u0,v0 = xgcd(E._p,2**64)
if abs(u0) > abs(v0):
u0,v0 = v0,u0
# p_w = p-wordsize rounded to largest machine word
# we need the inverse of -p, not of p
# so either
#g,u0,v0 = xgcd(E._p,2**64) # g = u0*p + v0*2**64
#u0 = 2**64 - u0
# or directly:
g,u0,v0 = xgcd(-E._p,2**64) # g = u0*p + v0*2**64
if u0 < 0:
u0 = -u0; v0 = -v0
u0 = 2**64+u0
print("U0 {:0=-#018x}".format(u0))
#params for the ep module in RELIC
......
......@@ -1389,6 +1389,7 @@ test_vector_BLS12 = [ # u, b, p.nbits(), cost, deg_h, label
# Fp2 = Fp[i]/(i^2+1), twist: b*(i+1), Fp12 = Fp2[w]/(w^6 - (i+1))
( -(2**73+2**72+2**50+2**24), 9, 440, 132, 6, "Zhaohui-Cheng in Barbulescu-Duquesne JoC 18"),
( -(2**12-2**48+2**71+2**72+2**73), 7, 442, 132, 6, "Zhaohui-Cheng in Barbulescu-Duquesne JoC 18"),
(-(2**74+2**73+2**63+2**57+2**50+2**17+1),1,446, 132, 6, "NancyMay24"),
( 2**76 + 2**53 + 2**31 + 2**11,10, 455, 132, 6, "relic/src/epx/relic_ep2_curve.c"),
# Fp2 = Fp[i]/(i^2+1), twist: b/(i+1), Fp12 = Fp2[w]/(w^6 - (i+1))
( -2**77 - 2**59 + 2**9 , 4, 461, 134, 6, "Barbulescu-Duquesne JoC 18"),
......
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