Fix Recalculate()

Recalculate did what should have been the right thing but wasn't because
of libsodium's mislabelling the "seed" as the secret key.
pull/1075/head
Jason Rhinelander 4 years ago
parent 860c5efd47
commit f7cd10a82e

@ -58,7 +58,12 @@ namespace llarp
bool
SecretKey::Recalculate()
{
return crypto_scalarmult_ed25519_base(data() + 32, data()) != -1;
PrivateKey key;
PubKey pubkey;
if (!toPrivate(key) || !key.toPublic(pubkey))
return false;
std::memcpy(data() + 32, pubkey.data(), 32);
return true;
}
bool

Loading…
Cancel
Save