BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
25 #include <boost/endian/conversion.hpp>
29 namespace graphene {
namespace protocol {
32 const string& msg, uint64_t custom_nonce)
38 if( 0 == custom_nonce )
41 constexpr uint64_t half_size = 32;
42 constexpr uint64_t high_bits = 0xff00000000000000ULL;
43 constexpr uint64_t low_bits = 0x00ffffffffffffffULL;
44 entropy <<= half_size;
57 message = vector<char>(text.begin(), text.end());
81 auto serial_checksum = string(
sizeof(
checksum),
' ');
82 (uint32_t&)(*serial_checksum.data()) = boost::endian::native_to_little(
checksum);
83 return serial_checksum +
text;
90 result.
checksum = boost::endian::little_to_native((uint32_t&)(*serial.data()));
std::string to_string(double)
std::string get_message(const fc::ecc::private_key &priv, const fc::ecc::public_key &pub) const
fc::sha512 get_shared_secret(const public_key &pub) const
contains only the public point of an elliptic curve key.
#define GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION(type)
const microseconds & time_since_epoch() const
an elliptic curve private key.
static private_key generate()
static memo_message deserialize(const string &serial)
static sha512 hash(const char *d, uint32_t dlen)
boost::endian::little_uint64_buf_t _hash[4]
public_key get_public_key() const
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
void set_message(const fc::ecc::private_key &priv, const fc::ecc::public_key &pub, const string &msg, uint64_t custom_nonce=0)
defines a message and checksum to enable validation of successful decryption
defines the keys used to derive the shared secret
boost::endian::little_uint32_buf_t _hash[7]
static sha224 hash(const char *d, uint32_t dlen)
unsigned aes_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext)
static sha256 hash(const char *d, uint32_t dlen)
unsigned aes_encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, unsigned char *iv, unsigned char *ciphertext)