Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit eae39974 authored by GUILLEVIC Aurore's avatar GUILLEVIC Aurore

corrected sign error in param computation for running RELIC

parent e489fcbb
...@@ -195,11 +195,15 @@ def print_parameters_for_RELIC(E): ...@@ -195,11 +195,15 @@ def print_parameters_for_RELIC(E):
# fill at 16 hexa digits, + 2 for the 'prefix '0x' makes 18 characters # fill at 16 hexa digits, + 2 for the 'prefix '0x' makes 18 characters
print("P{0} {1:0=-#018x}".format(i, pi)) print("P{0} {1:0=-#018x}".format(i, pi))
i+=1 i+=1
g,u0,v0 = xgcd(E._p,2**64) # p_w = p-wordsize rounded to largest machine word
if abs(u0) > abs(v0): # we need the inverse of -p, not of p
u0,v0 = v0,u0 # 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: if u0 < 0:
u0 = -u0; v0 = -v0 u0 = 2**64+u0
print("U0 {:0=-#018x}".format(u0)) print("U0 {:0=-#018x}".format(u0))
#params for the ep module in RELIC #params for the ep module in RELIC
......
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