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

Why private_key 64 bits? #27

Closed
iceriverdog opened this issue Jan 9, 2020 · 1 comment
Closed

Why private_key 64 bits? #27

iceriverdog opened this issue Jan 9, 2020 · 1 comment

Comments

@iceriverdog
Copy link

Soory sir:

i have a confuse that why private key is 64 bits? the order of G is 2^255 +277....493, so privacy_key shouldnt be one number less order? So why 64 bits?

Thank you!
Wang

@orlp
Copy link
Owner

orlp commented Jan 9, 2020

First, private_key is 64 bytes, not 64 bits. The first 32 bytes store a curve point, and as you can see some bits are ignored/set to make it valid:

private_key[0] &= 248;

The second 32 bytes store a second portion of the hash of the seed as it's needed for Ed25519's generation of r.

@orlp orlp closed this as completed Jan 9, 2020
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

No branches or pull requests

2 participants