-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug in bn.js - upgrade to latest bug-fixed version
This upgrades bn.js due to a bug that results in incorrect point multiplication, and therefore incorrect public keys and addresses, in some cases.. See these discussions: bitpay/bitcore#894 indutny/elliptic#17 indutny/elliptic#18 indutny/elliptic#19 indutny/bn.js@3557d78 Furthermore, the getG function is update to return the value of G that has precomputed values, as per the above discussions.
- Loading branch information
1 parent
1f9616e
commit dbeab00
Showing
4 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,8 +62,8 @@ Point.prototype.fromString = function(str) { | |
}; | ||
|
||
Point.getG = function() { | ||
var p = Point(ec.curve.g.getX(), ec.curve.g.getY()); | ||
return p; | ||
var g = ec.curve.g; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ryanxcharles
Author
Contributor
|
||
return g; | ||
}; | ||
|
||
Point.getN = function() { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
why not just
return ec.curve.g
?