Deprecated + unused + identical to key_to_wif
This commit is contained in:
parent
417f869dea
commit
d0aaad6117
2 changed files with 0 additions and 19 deletions
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
namespace graphene { namespace utilities {
|
||||
|
||||
std::string key_to_wif_single_hash(const fc::ecc::private_key& key);
|
||||
std::string key_to_wif(const fc::ecc::private_key& key);
|
||||
fc::optional<fc::ecc::private_key> wif_to_key( const std::string& wif_key );
|
||||
|
||||
|
|
|
|||
|
|
@ -35,24 +35,6 @@ std::string key_to_wif(const fc::ecc::private_key& key)
|
|||
return fc::to_base58(data, sizeof(data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated - this is for backward compatibility of keys generated
|
||||
*/
|
||||
std::string key_to_wif_single_hash(const fc::ecc::private_key& key)
|
||||
{
|
||||
fc::sha256 secret = key.get_secret();
|
||||
const size_t size_of_data_to_hash = sizeof(secret) + 1;
|
||||
const size_t size_of_hash_bytes = 4;
|
||||
char data[size_of_data_to_hash + size_of_hash_bytes];
|
||||
data[0] = (char)0x80;
|
||||
memcpy(&data[1], (char*)&secret, sizeof(secret));
|
||||
fc::sha256 digest = fc::sha256::hash(data, size_of_data_to_hash);
|
||||
digest = fc::sha256::hash(digest);
|
||||
memcpy(data + size_of_data_to_hash, (char*)&digest, size_of_hash_bytes);
|
||||
return fc::to_base58(data, sizeof(data));
|
||||
}
|
||||
|
||||
|
||||
fc::optional<fc::ecc::private_key> wif_to_key( const std::string& wif_key )
|
||||
{
|
||||
std::vector<char> wif_bytes = fc::from_base58(wif_key);
|
||||
|
|
|
|||
Loading…
Reference in a new issue