-
Notifications
You must be signed in to change notification settings - Fork 45
isOnCurve not right #31
Comments
@pantaovay not sure I'm getting the problem. Does it return Sidenote, I had an issue with the |
For address I checked #12 , the reason that the function generates false PDA is I use another way to avoid this because the isOnCurve function in the other js lib is very difficult. public static function isOnCurve(PublicKey $publicKey): bool
{
try {
$response = Di::getHttpClient()->sendGetRequest(sprintf(
'http://127.0.0.1:3000/publickey/%s/is_on_curve',
$publicKey->toBase58()
));
$responseBody = json_decode($response->getBody()->getContents(), true);
if (!is_array($responseBody) || !isset($responseBody['is_on_curve'])) {
throw new \Exception($responseBody['error_code']);
}
return (bool) $responseBody['is_on_curve'];
} catch (\Exception $exception) {
Di::getLogger()->error('Check is on curve error: ' . $exception->getMessage());
return false;
}
} |
I found out here that Using |
@gabrielkoerich good catch, this does indeed seem like a bug. Feel free to write a pull request for it or I will eventually get to it in the future as it's bothering me a little 😄 |
This is fixed in 7b1e6ae thanks to @gabrielkoerich Not creating a new release yet, see #36 |
isOnCurve
not rightBase 58 Publickey:
q5xfHVuAsGmKRTmJNshERHHkVnHKxRX3cKzz5cYnFRn
It show return
true
forisOnCurve
function. Butfalse
returnedThe text was updated successfully, but these errors were encountered: