ionux/phactor

Exception on simple keypair generation

Closed this issue · 4 comments

`<?php
function __autoload($class_name) {
require_once($class_name.'.php');
}

$key = new \Phactor\Key;
$sin = new \Phactor\Sin;
$info = $key->GenerateKeypair();

$sin->Generate($info['public_key_compressed']);

echo $sin;

?>`
This produces the output

Fatal error: Uncaught exception 'Exception' with message 'Point test failed! Cannot continue. I tested the point: array ( 'x' => '-16740205803149137651623114114599099817536015447806981022915814846754846768662', 'y' => '79340325761292965392925272385671402859927213103433024015441329572037335642515', ) but got the point: array ( 'x' => '-50932641966273861645740042139834147665108735952780996106525278283865300222178', 'y' => '62549719118241537510126563656857040093089832702437643958070816567220236505306', 'y2' => '6294887291908088168543866780339105322456190405182270869093984478299220111581432369106643824733854210118622078758306113158893557825714373857362007875525225', 'x3' => '-4691183041294739471042812754488522661257714844216997202780754154212615158496937547487211042974633230548317680709818342564343894995604863316997408970941145542388630022299843369505638952520645357245898712998144885013841039740293528', 'ax' => '0', )' in C:\xampp\htdocs\project\Phactor\Point.php:185 Stack trace: #0 C:\xampp\htdocs\project\Pha in C:\xampp\htdocs\project\Phactor\Point.php on line 185

Am I doing anything wrong here?
I do not have the technical finesse within the realm of cryptography to identify an error in Point.php

ionux commented

Are you still getting this error, @Yoshidesu ?

helped me: sudo apt install php7.1-gmp

ionux commented

Awesome, thanks for the update! Very helpful 👍

I've got a same problem. GMP and BC installed. Can you tip me on it?
php 7.2