starkbank / ecdsa-php

A lightweight and fast PHP ECDSA library
https://starkbank.com
MIT License
82 stars 12 forks source link

PublicKey::fromString not working after upgrade to v2 #23

Open vincent-lu opened 9 months ago

vincent-lu commented 9 months ago

Hi first thanks for the library.

I use this library to work with SendGrid's Event Webhooks: Docs: https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features Demo: https://github.com/sendgrid/sendgrid-php/tree/main/lib/eventwebhook

The demo uses starkbank/ecdsa:0.05 which works just fine when calling \EllipticCurve\PublicKey::fromString($myPubKeyString). However after upgrade to starkbank/ecdsa:2.0.2 it gives an error message saying gmp_init(): Argument #1 ($num) is not an integer string.

Would love to use the latest version of this library but for now I have to downgrade it back to 0.0.5.

Can you advise what I should do to make the latest version work? Thanks.

simoheinonen commented 1 month ago

https://github.com/sendgrid/sendgrid-php/pull/1111 should fix it

vincent-lu commented 1 month ago

Thanks @simoheinonen hopefully it gets accepted