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

Improve KeyPair types #770

Open
fboucquez opened this issue Mar 2, 2021 · 0 comments
Open

Improve KeyPair types #770

fboucquez opened this issue Mar 2, 2021 · 0 comments
Labels
P3 Issue Low severity cosmetic issues with minor inconvenience

Comments

@fboucquez
Copy link
Contributor

fboucquez commented Mar 2, 2021

This one should receive a Uint8Array instead of strings

https://github.com/nemtech/symbol-sdk-typescript-javascript/blob/main/src/core/crypto/KeyPair.ts#L32

There are a couple of untyped methods. Revisit those. KeyPair interface should be used.

Note: I've been testing https://github.com/paulmillr/noble-ed25519. It seems 6x times (or more) faster than tweetnacl. It's also pretty small, just one file. Passes https://raw.githubusercontent.com/nemtech/test-vectors/main/2.test-sign.json tests

We only use tweetnacl for the sign, verify and get public key in the KeyPair.ts class. We could consider replacing tweetnacl

@fboucquez fboucquez added the P3 Issue Low severity cosmetic issues with minor inconvenience label Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Issue Low severity cosmetic issues with minor inconvenience
Projects
None yet
Development

No branches or pull requests

1 participant