Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in _projDbl for ordinary Edwards curves #26

Open
TiberiumFusion opened this issue Jul 24, 2020 · 0 comments
Open

Error in _projDbl for ordinary Edwards curves #26

TiberiumFusion opened this issue Jul 24, 2020 · 0 comments

Comments

@TiberiumFusion
Copy link

I'm trying to define and work with an ordinary Edwards curve, but it seems like there's an error in the implementation of the math for ordinary Edwards curves (in comparison, the math for twisted curves doesn't throw any errors).

Undefined property $this->c at
https://github.com/simplito/elliptic-php/blob/master/lib/Curve/EdwardsCurve/Point.php#L143

// H = (c * Z1)^2
$h = $this->curve->_mulC($this->c->redMul($this->z))->redSqr();

This is how the elliptic,js code does it:
https://github.com/indutny/elliptic/blob/475f066aebd14681591f0f0f18a2abc0ded8c390/lib/elliptic/curve/edwards.js#L252

// H = (c * Z1)^2
var h = this.curve._mulC(this.z).redSqr();

I'm not versed at all in the maths for working with Edwards curve, but this looks like a typo in the php version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant