ChanBan
ChanBan

Reputation: 41

Understanding OpenSSL ECDH code

I have seen there are a few posts in stack overflow regarding this topic, most of them without any answer like

OpenSSL calculate ECDH secret

My question is I have been using these commands from the link

https://wiki.openssl.org/index.php/Command_Line_Elliptic_Curve_Operations

I wanted to benchmark the execution time of the curves using the command

1)time openssl ecparam -name secp256k1 -genkey -noout -out secp256k1-key.pem

I get time results but I do not understand if this corresponds to public key generation or shared secret key generation

Also I dont understand if this uses affine coordinates or Jacobian projective coordinates?

Is there a way to know more about it?

If someone has previous experience on this, any kind of suggestion will be very helpful. Thank you for your patience! , but I do not understand when I type

Upvotes: 0

Views: 407

Answers (1)

Matt Caswell
Matt Caswell

Reputation: 9502

I get time results but I do not understand if this corresponds to public key generation or shared secret key generation

That command is about generating a private/public key pair (as suggested by the "genkey" argument). Creation of a shared secret is usually referred to as key derivation or key agreement.

Also I dont understand if this uses affine coordinates or Jacobian projective coordinates?

The key as it is stored in the pem file will use affine co-ordinates (possibly in a compressed form). While being held in memory to perform operations they may be held in Jacobian projective co-ordinates. But these are converted to/from affine co-ordinates when the key is written out/read in.

Upvotes: 0

Related Questions