Cryptography Reference
In-Depth Information
a discrete logarithm in polynomial time. Well, for elliptic curves, there's an O( n )
algorithm to multiply a point by a scalar n , but no feasible inverse operation.
You can't “divide” a point by a scalar and fi nd the original point. This property
of being able to perform an operation in one direction in a reasonable amount of
time, but not invert it, makes it usable as a public-key cryptosystem.
Diffi e-Hellman can be redefi ned in terms of elliptic-curve operations. The
private key is a scalar, and the public key is that scalar, multiplied by another
shared point G. The two entities, A and B, which want to perform a secure key
exchange, each have a private scalar and a public point, plus another shared point
and, of course, the a , b , and p that defi ne an elliptic-curve and its prime fi eld. If
A multiplies his private key by B's public-key and B multiplies his private key
by A's public key, they both arrive at the same point Z because they started at
the same shared point G. Z can't be computed by anybody else without access
to one of the private keys, so Z can be used as a shared secret. Typically the
x-coordinate of Z is used and the y-coordinate is discarded.
At this point, your head may be spinning. An example might help clarify
things. To keep things semi-readable, just stick to integer arithmetic for now
and use small (less than 32-bit) values as an example.
1. Start off with a few defi nitions as shown in Listing 3-37.
Listing 3-37: “ecc_int.h” structure defi nitions
typedef struct
{
int x;
int y;
}
point;
typedef struct
{
int private_key;
point public_key;
}
key_pair;
/**
* Describe y^2 = (x^3 + ax + b) % p
*/
typedef struct
{
int p;
int a;
int b;
point G; // base point
}
domain_parameters;
 
Search WWH ::




Custom Search