Skip to content

Commit

Permalink
curves: Set b to 1 for curve25519
Browse files Browse the repository at this point in the history
The montgomery parameters for curve25519 define b to be 1. Even though
this library doesn't use it for calculations, for consistency reasons
setting it to the standartized value improves readability. Also using it
in calculations outside of the library it resulted in problems and
errors, which will be fixed with this change.
  • Loading branch information
oberien authored and indutny committed Dec 27, 2016
1 parent cbace46 commit 79e2f37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/elliptic/curves.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ defineCurve('curve25519', {
prime: 'p25519',
p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
a: '76d06',
b: '0',
b: '1',
n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
hash: hash.sha256,
gRed: false,
Expand Down

0 comments on commit 79e2f37

Please sign in to comment.