BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Variables
a
c
d
e
g
h
l
n
o
t
w
Typedefs
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Typedefs
a
b
c
d
e
f
h
i
l
m
n
o
p
r
s
t
v
Enumerations
Enumerator
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
a
b
c
d
e
f
g
h
m
n
o
p
s
t
u
v
w
y
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
l
m
n
p
r
s
t
u
v
w
Functions
Variables
Typedefs
Macros
_
a
b
c
d
e
f
g
i
l
m
n
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
libraries
protocol
include
graphene
protocol
memo.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3
*
4
* The MIT License
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
* THE SOFTWARE.
23
*/
24
#pragma once
25
#include <
graphene/protocol/types.hpp
>
26
27
namespace
graphene
{
namespace
protocol {
28
40
struct
memo_data
41
{
42
public_key_type
from
;
43
public_key_type
to
;
55
uint64_t
nonce
= 0;
59
vector<char>
message
;
60
62
void
set_message
(
const
fc::ecc::private_key
& priv,
63
const
fc::ecc::public_key
& pub,
const
string
& msg, uint64_t custom_nonce = 0);
64
65
std::string
get_message
(
const
fc::ecc::private_key
& priv,
66
const
fc::ecc::public_key
& pub)
const
;
67
};
68
75
struct
memo_message
76
{
77
memo_message
(){}
78
memo_message
( uint32_t
checksum
,
const
std::string&
text
)
79
:
checksum
(
checksum
),
text
(
text
){}
80
81
uint32_t
checksum
= 0;
82
std::string
text
;
83
84
string
serialize
()
const
;
85
static
memo_message
deserialize
(
const
string
& serial);
86
};
87
88
} }
// namespace graphene::protocol
89
90
FC_REFLECT
(
graphene::protocol::memo_message
, (checksum)(text) )
91
FC_REFLECT
(
graphene::protocol::memo_data
, (from)(to)(nonce)(message) )
92
93
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
(
graphene::protocol::memo_message
)
94
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
(
graphene::protocol::memo_data
)
graphene::protocol::memo_data::get_message
std::string get_message(const fc::ecc::private_key &priv, const fc::ecc::public_key &pub) const
Definition:
memo.cpp:61
graphene::protocol::memo_message::memo_message
memo_message(uint32_t checksum, const std::string &text)
Definition:
memo.hpp:78
graphene::protocol::memo_data::nonce
uint64_t nonce
Definition:
memo.hpp:55
fc::ecc::public_key
contains only the public point of an elliptic curve key.
Definition:
elliptic.hpp:35
graphene::protocol::public_key_type
Definition:
types.hpp:312
graphene::protocol::memo_message::memo_message
memo_message()
Definition:
memo.hpp:77
graphene::protocol::memo_data::to
public_key_type to
Definition:
memo.hpp:43
graphene::protocol::memo_message::serialize
string serialize() const
Definition:
memo.cpp:79
fc::ecc::private_key
an elliptic curve private key.
Definition:
elliptic.hpp:89
graphene::protocol::memo_message::checksum
uint32_t checksum
Definition:
memo.hpp:81
types.hpp
graphene::protocol::memo_message::deserialize
static memo_message deserialize(const string &serial)
Definition:
memo.cpp:86
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition:
types.hpp:85
graphene::protocol::memo_data::set_message
void set_message(const fc::ecc::private_key &priv, const fc::ecc::public_key &pub, const string &msg, uint64_t custom_nonce=0)
Definition:
memo.cpp:31
graphene::protocol::memo_data::message
vector< char > message
Definition:
memo.hpp:59
graphene::protocol::memo_message
defines a message and checksum to enable validation of successful decryption
Definition:
memo.hpp:75
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition:
reflect.hpp:388
graphene::protocol::memo_data
defines the keys used to derive the shared secret
Definition:
memo.hpp:40
graphene::protocol::memo_message::text
std::string text
Definition:
memo.hpp:82
graphene::protocol::memo_data::from
public_key_type from
Definition:
memo.hpp:42
graphene
Definition:
api.cpp:48
Generated on Fri Dec 15 2023 06:12:43 for BitShares-Core by
1.8.17