ionux / phactor

Phactor is a high-performance PHP implementation of the elliptic curve math functions needed for EC keypair and ECDSA signature generation, validating signatures, validating curve points, creating SINs and much more.
https://github.com/ionux/phactor
MIT License
50 stars 18 forks source link

NOT AN ISSUE - just a newbie asking for help #13

Closed citizen010 closed 7 months ago

citizen010 commented 11 months ago

Sorry to bother you guys, I know this is probably the wrong place to ask this question, but.... Please, can you provide a code sample for class files inclusion ? I'm on PHP 8.2.11 After cloning the repo, my files structure is as such:

---\subfolder\index.php
---\subfolder\phactor\src\*.php
---\subfolder\phactor\tests\*.php 

This is how my actual file looks like:

<?php
//
// THIS FILE IS ---\subfolder\index.php
//
// Class inclusion code (this is the part I'm having troubles with...)
use Phactor;
require_once "./phactor/src/BaseObject.php";
require_once "./phactor/src/Key.php";
// etc...
// INCLUDE nor REQUIRE nor REQUIRE_ONCE are working, code stops with no errors.

// Code below should work AFTER class inclusion is working
$key = new \Phactor\Key;
$info = $key->GenerateKeypair();
$sig = new \Phactor\Signature;
$signature = $sig->generate('my message to sign...', $info['private_key_hex']);
echo "Signature = " . $signature;
?>

Thanks in advance to whoever will spend is valuable time for helping this newbie.

ionux commented 9 months ago

Oh man, I apologize for just now seeing this! I've not had a chance to test the code under PHP 8+ so there may be some under-the-hood breaking language changes. I'll try to set aside some time to install the latest PHP version and test it out.

citizen010 commented 9 months ago

No problem. I managed to solve the issue on my own. Thanks anyway.

Inviato da Proton Mail mobile

-------- Messaggio originale -------- Il 16 Dic 2023, 06:20, Rich Morgan ha scritto:

Oh man, I apologize for just now seeing this! I've not had a chance to test the code under PHP 8+ so there may be some under-the-hood breaking language changes. I'll try to set aside some time to install the latest PHP version and test it out.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ionux commented 9 months ago

Oh ok, great! Do you mind sharing here what the issue was and how you solved it in case someone else runs into it? Could be helpful. 😄