elliptic-php icon indicating copy to clipboard operation
elliptic-php copied to clipboard

PHP Fatal error: Uncaught Error: Class 'Elliptic\EC' not found

Open istabraq-iot opened this issue 4 years ago • 0 comments

It shows me this error when i run this code:

<?php
require 'vendor/autoload.php';
use Elliptic\EC;

// Create and initialize EC context
// (better do it once and reuse it)
$ec = new EC('secp256k1');

// Generate keys
$key = $ec->genKeyPair();

$publicKey = $key->getPublic('hex');
$privateKey = $key->getPrivate('hex');

// Print the keys to the console

echo "The address1 is {$publicKey}. \r\n";
echo "The address1 is {$privateKey}. \r\n";

error:

PHP Fatal error: Uncaught Error: Class 'Elliptic\EC' not found in /home/istabraq/bctest/test2/test2.php:6 Stack trace: #0 {main} thrown in /home/istabraq/bctest/test2/test2.php on line 6

any help please?

istabraq-iot avatar May 01 '20 22:05 istabraq-iot