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

Fix genKeyPair() generates not-fully-256bits private key #5

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

sickworm
Copy link

I found a mistake which makes private key generated by genKeyPair() is not fully 256bits.

var key = sm2.genKeyPair();
console.log(key.toString());

// in current version will get:
// public: (cc9f54f037556f542e2683d7e6628dc9dcf9dd062ae1b9702aecf34e444649ed, 996ff71434f452362a5f941130d39ba25c9411119987d76801bf04b2eb8ea84),
// private: 00000000000d55f919276c8146c43ff52b449a7dac2043c94a2fb0bcf496aae0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants