Post
Topic
Board Development & Technical Discussion
Re: Elliptic curve math question
by
casascius
on 30/11/2011, 04:09:28 UTC
Please, I insist, can you come up with an example using small baby numbers?

I am not sure how to do that.  The elliptic curve digital signature algorithm requires the use of some pre-defined constants, none of which are baby numbers.

Also, I am not actually doing the math, I am using a library for it.  But maybe I can add the following helpful information if you're following my example.

G is a constant that is already defined.  It is a "point" (think of graphing), so G is actually a container for two numbers, it has an X and a Y component.  I don't have to care what G is, and its X and Y are both some huge numbers I don't need to look at.  (both numbers are between 2254 and 2256).

Multiplying a "point" by a "number" yields another "point".  To get the public key, I take my private key (which is a number), and multiply them by G (which is a point), resulting in another "point".  The multiplying is actually a complicated operation that I know nothing about, all I know is that I put in a "point" and a "number", and out comes a "point".

I can add two "points" together, and out comes another "point".  It is not as simple as X=X1+X2 and Y=Y1+Y2, but rather, it is some sort of math I can just forget about and consider to be complete magic.  All I care is that I can add two "points" together, and get another "point".

Multiplying two private keys together is easy, they are just regular numbers.  But a private key isn't allowed to be bigger than the number N (another constant defined by elliptic curve, but this is a regular number slightly smaller than 2256, not a point), so if the result is bigger than N, I need to divide the result by N and keep only the remainder, so the result remains under N.  (that's why I am doing Mod() in my code).

None of the examples given by anyone here assumes an understanding of the details of the magic math of how this point multiplication and point addition work.  I don't understand it, and probably don't need to.  But all of the examples DO assume an understanding that "point times number gives a point", and "point plus point equals another point".  So when someone writes G * N1, it is assumed you know that G is a point, N1 is a regular number, and that the result of that multiplication is a point.