orlp / ed25519

Portable C implementation of Ed25519, a high-speed high-security public-key signature system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why private_key 64 bits?

iceriverdog opened this issue · comments

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

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.