Removed keytype config field in favour of key prefix.

This commit is contained in:
Ravin Perera
2019-10-17 10:18:51 +05:30
parent 0fb9ebf79f
commit da9c5de9d0
4 changed files with 8 additions and 14 deletions

View File

@@ -21,10 +21,10 @@ int init()
return 0;
}
/**
/**l
* Generates a signing key pair using libsodium and assigns them to the provided strings.
*/
void generate_signing_keys(std::string &pubkey, std::string &seckey, std::string &keytype)
void generate_signing_keys(std::string &pubkey, std::string &seckey)
{
// Generate key pair using libsodium default algorithm.
// Currently using ed25519. So append prefix byte to represent that.
@@ -36,10 +36,8 @@ void generate_signing_keys(std::string &pubkey, std::string &seckey, std::string
seckey[0] = KEYPFX_ed25519;
crypto_sign_keypair(
reinterpret_cast<unsigned char *>(pubkey.data() + 1),
reinterpret_cast<unsigned char *>(seckey.data() + 1));
keytype = crypto_sign_primitive();
reinterpret_cast<unsigned char *>(pubkey.data() + 1), // +1 to skip the prefix byte.
reinterpret_cast<unsigned char *>(seckey.data() + 1)); // +1 to skip the prefix byte.
}
/**