Bitshares-Core  2.0.181105
BitShares blockchain implementation and command-line interface software
Public Member Functions | Public Attributes | List of all members
graphene::chain::memo_data Struct Reference

defines the keys used to derive the shared secret More...

#include <memo.hpp>

Public Member Functions

void set_message (const fc::ecc::private_key &priv, const fc::ecc::public_key &pub, const string &msg, uint64_t custom_nonce=0)
std::string get_message (const fc::ecc::private_key &priv, const fc::ecc::public_key &pub) const

Public Attributes

public_key_type from
public_key_type to
uint64_t nonce = 0
vector< char > message

Detailed Description

defines the keys used to derive the shared secret

Because account authorities and keys can change at any time, each memo must capture the specific keys used to derive the shared secret. In order to read the cipher message you will need one of the two private keys.

If from == to and from == 0 then no encryption is used, the memo is public. If from == to and from != 0 then invalid memo data

Definition at line 40 of file memo.hpp.

Member Function Documentation

◆ get_message()

string graphene::chain::memo_data::get_message ( const fc::ecc::private_key &  priv,
const fc::ecc::public_key &  pub 
) const

Definition at line 56 of file memo.cpp.

◆ set_message()

void graphene::chain::memo_data::set_message ( const fc::ecc::private_key &  priv,
const fc::ecc::public_key &  pub,
const string &  msg,
uint64_t  custom_nonce = 0 
custom_nonce is for debugging only; do not set to a nonzero value in production

Definition at line 29 of file memo.cpp.

Member Data Documentation

◆ from

public_key_type graphene::chain::memo_data::from

Definition at line 42 of file memo.hpp.

◆ message

vector<char> graphene::chain::memo_data::message

This field contains the AES encrypted packed memo_message

Definition at line 59 of file memo.hpp.

◆ nonce

uint64_t graphene::chain::memo_data::nonce = 0

64 bit nonce format: [ 8 bits | 56 bits ] [ entropy | timestamp ] Timestamp is number of microseconds since the epoch Entropy is a byte taken from the hash of a new private key

This format is not mandated or verified; it is chosen to ensure uniqueness of key-IV pairs only. This should be unique with high probability as long as the generating host has a high-resolution clock OR a strong source of entropy for generating private keys.

Definition at line 55 of file memo.hpp.

◆ to

public_key_type graphene::chain::memo_data::to

Definition at line 43 of file memo.hpp.

The documentation for this struct was generated from the following files: