3

Elliptic Curves Basics Possible Bug

 1 year ago
source link: https://www.codeabbey.com/index/forum_topic/0591c780d06a3b202c8867aa0e539460
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Elliptic Curves Basics Possible Bug

Back to General discussions forum

CSFPython     2023-05-11 11:46:56

I have just had three tries at submitting a solution for this problem. In each case the solution was rejected, despite the fact that the solution agreed with the one supplied by the checker. However, the solution supplied by the checker (in each case) began with a spurious integer value which was not part of the solution. In other words the number of integers given is one more than the required number.

There are also two very minor issues with the problem description.

The first example uses p = 11. This is then followed by a diagram showing points which are clearly not for p = 11. It soon becomes apparent that these are points for p = 19 but it would be helpful to make this clear at an earlier position in the text.

The final example, just before the problem description, finds a result of R = (17,5). The final flip is incorrect. The value of R is actually (17,7) when p = 19.

The problem itself is another really interesting one. I'm sure that the glitch will be easy to fix.

CSFPython     2023-05-11 12:16:31

Rodion, thanks for fixing the bug. However, I have just spotted something else. When I looked more closely at the test data I noticed that, out of 17 sets of data, only one set had two different points. All of the others had a repeated point. I have checked several other sets of test data. Some were entirely made up of repeated points. Two of them had only 1 instance of 2 distinct points. Something appears to be wrong with the part of the problem setter which decides whether to use a single point or two separate points.

Rodion (admin)     2023-05-11 12:42:40
User avatar

Clive, yes, there is such "skew" in data - I noticed it yesterday and haven't yet found good way to fix it.

It seems to be related to the properties of the curves and points.

The code for generation is like this:

if (random value between 1 and 17) mod 3 is 0 then
    pick single point and request to "double it"
else
    pick a pair of points and request to add them

now execute calculations for result

if result is single point then
    add it to test-cases
otherwise
    retry

So it looks like many random pairs of points fail to produce single result. I haven't yet understood this fact clearly.

Shall see about amending this. BTW this leads to couple of questions I don't have good understanding about:

  • what are cases when adding points produces zero or more than one results (one I suppose when there is a couple of equal roots in the equation)
  • in case of point "multiplication" (iteratively adding P+P+P...) this seemingly is doomed to end sooner or later but how to understand when exactly

Most probably this all is explained somewhere just more googling will help me, though it may happen my math won't be enough to understand explanations :)

CSFPython     2023-05-11 13:47:08

Rodion, Given the small size of the values of p in the data sets, another approach could be to take all pairs of points and store the pairs which do give rise to a third point. The problem setter can then pick the required number of pairs (at random) from this list. This should enable you to extend the number of p values that are available (possibly all of them, assuming that you are sticking to prime values of p). This should be well within the 1 second limit for the problem setter since there are typically fewer than 40,000 pairs of points.

Please login and solve 5 problems to be able to post at forum

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK