The secret_int_to_points function chooses a prime just greater than secret_int and num_points. The reverse function points_to_secret_int chooses a prime just greater than all the y coordinates in the shares.
Suppose the prime in the first case was 8191 (say secret_int was 5000). Its possible that the y coordinates of all points generated is less than 127. If this happens, then the prime number chosen by the points_to_secret_int function is 127 instead of 8191. Won't this lead to inconsistencies in the recovery of the original secret? Am I missing something here?
The
secret_int_to_points
function chooses a prime just greater thansecret_int
andnum_points
. The reverse functionpoints_to_secret_int
chooses a prime just greater than all the y coordinates in the shares.Suppose the prime in the first case was 8191 (say
secret_int
was 5000). Its possible that the y coordinates of all points generated is less than 127. If this happens, then the prime number chosen by thepoints_to_secret_int
function is 127 instead of 8191. Won't this lead to inconsistencies in the recovery of the original secret? Am I missing something here?