indutny / elliptic

Fast Elliptic Curve Cryptography in plain javascript
1.7k stars 381 forks source link

ed25519 g doesn't have .toJSON() #186

Open mvayngrib opened 5 years ago

mvayngrib commented 5 years ago

for the short curves, i can precompute(), and then sacrifice bundle size for initialization time by monkey-patching precomputed points in: https://github.com/indutny/elliptic/compare/master...mvayngrib:mv/precompute?expand=1#diff-cdfd2b6ed01af7e484fd00fbfe80dbafR5

however, for ed25519, i can't seem to export the precomputed g. Trying to JSON.stringify(curve.g.precomputed) directly doesn't work due to circular refs. Can anyone help? Thanks!