Re: ECDSA Signature

Jeffrey Walton <[email protected]> Wed, 8 Nov 2023 14:33:18 -0500
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <CAH8yC8=bmjkzzLn8PpDUY0BX4ahwyMVWp7Yue5N5UHAb6MuBFA@mail.gmail.com>
On Wed, Nov 8, 2023 at 10:33=E2=80=AFAM Ricardo Alex <ricardosurfmusic@gmai=
l.com> wrote:
>
> 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 curv=
e, considering I have private key, public key r,s values of the signature a=
nd the message signed, is it possible to find the Y coordinate of point R?

It is not the case that r =3D 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

--=20
You received this message because you are subscribed to the Google Groups "=
Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/=
cryptopp-users/CAH8yC8%3DbmjkzzLn8PpDUY0BX4ahwyMVWp7Yue5N5UHAb6MuBFA%40mail=
.gmail.com.