jlouis / enacl

Erlang bindings for NaCl / libsodium
MIT License
197 stars 59 forks source link

add crypto_sign_ed25519_sk_to_pk #38

Closed ghost closed 4 years ago

ghost commented 5 years ago

for https://github.com/jlouis/enacl/issues/37

ghost commented 5 years ago

Example in elixir:

iex(1)> %{public: public, secret: secret} = :enacl.sign_keypair
%{
  public: <<52, 178, 46, 238, 11, 79, 60, 150, 5, 249, 177, 70, 145, 93, 236,
    90, 89, 53, 25, 110, 34, 190, 24, 67, 10, 52, 1, 68, 164, 11, 240, 80>>,
  secret: <<53, 12, 49, 33, 194, 242, 248, 217, 3, 240, 6, 193, 237, 125, 86,
    247, 191, 158, 4, 210, 116, 87, 13, 197, 245, 14, 139, 129, 35, 123, 181,
    205, 52, 178, 46, 238, 11, 79, 60, 150, 5, 249, 177, 70, 145, 93, 236, 90,
    ...>>
}
iex(2)> :enacl.crypto_sign_ed25519_sk_to_pk(secret)
<<52, 178, 46, 238, 11, 79, 60, 150, 5, 249, 177, 70, 145, 93, 236, 90, 89, 53,
  25, 110, 34, 190, 24, 67, 10, 52, 1, 68, 164, 11, 240, 80>>