tel / saltine

Cryptography that's easy to digest (NaCl/libsodium bindings)
https://github.com/tel/saltine
MIT License
61 stars 29 forks source link

SecretKey -> PublicKey function #32

Closed athanclark closed 7 years ago

athanclark commented 7 years ago

I believe there is a method to which libsodum provides the ability to derive a secret key's associated public key - https://github.com/athanclark/purescript-crypt-nacl/blob/master/src/Crypt/NaCl/Box.purs#L34

But, I'm not sure if it's possible, given that this is just a "tweetnacl" implementation in javascript that's been wrapped.

linearray commented 7 years ago

That function is just an alias for crypto_scalarmult_base, for which there is already a binding.

It is my understanding that if you call this function with your secret key, you should get back the public key. https://github.com/tel/saltine/blob/8d3837a027c35511e584c705e47b96f626a2a900/src/Crypto/Saltine/Core/ScalarMult.hs#L96

linearray commented 7 years ago

Customer seems to be happy with the proposed solution, closing.