ECDSA Signature

55 views
Skip to first unread message

Ricardo Alex

unread,
Nov 8, 2023, 10:33:18 AM11/8/23
to Crypto++ Users
This code gives me a signature r,s 

std::string signaturehex;
StringSource ss2(message, true,
new CryptoPP::SignerFilter(prng, signer,
new CryptoPP::HexEncoder(
new CryptoPP::StringSink(signaturehex))));

 I understand that r is the x coordinate of a point R in the eliptic curve, considering I have private key, public key r,s values of the signature and the message signed, is it possible to find the Y coordinate of point R?

Thanks,

Jeffrey Walton

unread,
Nov 8, 2023, 2:33:31 PM11/8/23
to cryptop...@googlegroups.com
It is not the case that r = f(s) for the signature. 'r' and 's' are
two calculated integers (not a point), and computed at
<https://github.com/weidai11/cryptopp/blob/master/gfpcrypt.h#L315>.

Typically when working with elliptic curves, the private key is an
exponent, and it is an Integer. The public key is a point, and the
point is a pair of integers with x and y components. For public and
private keys, you can solve the y coordinate given the x coordinate.
In fact, compressed points use this trick to save space. A compressed
point only provides the x coordinate, if I recall correctly.

Also take a look at
<https://www.cryptopp.com/wiki/Elliptic_Curve_Digital_Signature_Algorithm>.
In particular, see the example OpenSSL and Java. It converts between
ASN.1 format and IEEE P1363 formats. OpenSSL and Java use an ASN.1/DER
signature format, and Crypto++ uses IEEE P1363 format.

Jeff
Reply all
Reply to author
Forward
0 new messages