StableLib / stablelib

A stable library of useful TypeScript/JavaScript code
https://www.stablelib.com
Other
175 stars 36 forks source link

Ed25519 to X25519 conversion #11

Closed kdenhartog closed 4 years ago

kdenhartog commented 5 years ago

I'm not seeing the functionality to do a conversion from an Ed25519 key to an X25519 key, but I did see that you wrote this package which is capable of doing this. Would you be interested if I made a PR to add this functionality into stablelib? Also, could the return object of these functions be used with the X25519 packages?

dchest commented 5 years ago

Yes, thank you! I think it would make sense to just add conversion functions to https://github.com/StableLib/stablelib/blob/master/packages/ed25519/ed25519.ts to reuse existing arithmetic functions instead of copying them (I did it as a separate package from TweetNaCl.js to keep it a true port of TweetNaCl without adding anything, but here we can go wild :-)

dchest commented 4 years ago

Implemented (https://github.com/StableLib/stablelib/commit/e39714a078083161ef4761326507eecdc704f4ac) and published.