Hi all!
I wonder how to get public key from private key via libnacl\libsodium (Python).
There is already amazing implementation by Gimre by using pure Python.
I just want to try develop this part by myself so I have few questions.
This is how I try to to this by my own:
Convert private key from hex into byte string.
Reverse this string.
Make Keccak (512 bits) hash from this byte string.
Perform call of crypto_sign_ed25519_sk_to_pk
function from nacl\libsodium with this binary hash as parameter.
And here is the main problem - hash is different as expected.
I also tried to call crypto_scalarmult_base
with hash as parameter.
Shifting bytes (eg. myhash[0] &= 0xF8
) did not help too.
I suppose to think, there is difference in scalar_multiplication function in pure python and nacl\sodium.
Can you point me what I am missing?
Thank you a lot!