Electroneum
protocol.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017-2020, The Electroneum Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 
30 #ifndef ELECTRONEUM_PROTOCOL_H
31 #define ELECTRONEUM_PROTOCOL_H
32 
33 #include "trezor_defs.hpp"
34 #include "device/device_cold.hpp"
35 #include "messages_map.hpp"
36 #include "transport.hpp"
37 #include "wallet/wallet2.h"
38 
39 namespace hw{
40 namespace trezor{
41 namespace protocol{
42 
43  std::string key_to_string(const ::crypto::ec_point & key);
44  std::string key_to_string(const ::crypto::ec_scalar & key);
45  std::string key_to_string(const ::crypto::hash & key);
46  std::string key_to_string(const ::rct::key & key);
47 
48  void string_to_key(::crypto::ec_scalar & key, const std::string & str);
49  void string_to_key(::crypto::ec_point & key, const std::string & str);
50  void string_to_key(::rct::key & key, const std::string & str);
51 
52  template<class sub_t, class InputIterator>
53  void assign_to_repeatable(::google::protobuf::RepeatedField<sub_t> * dst, const InputIterator begin, const InputIterator end){
54  for (InputIterator it = begin; it != end; it++) {
55  auto s = dst->Add();
56  *s = *it;
57  }
58  }
59 
60  template<class sub_t, class InputIterator>
61  void assign_from_repeatable(std::vector<sub_t> * dst, const InputIterator begin, const InputIterator end){
62  for (InputIterator it = begin; it != end; it++) {
63  dst->push_back(*it);
64  }
65  };
66 
67  template<typename T>
68  bool cn_deserialize(const void * buff, size_t len, T & dst){
69  std::stringstream ss;
70  ss.write(static_cast<const char *>(buff), len); //ss << tx_blob;
71  binary_archive<false> ba(ss);
72  bool r = ::serialization::serialize(ba, dst);
73  return r;
74  }
75 
76  template<typename T>
77  bool cn_deserialize(const std::string & str, T & dst){
78  return cn_deserialize(str.data(), str.size(), dst);
79  }
80 
81  template<typename T>
82  std::string cn_serialize(T & obj){
83  std::ostringstream oss;
84  binary_archive<true> oar(oss);
85  bool success = ::serialization::serialize(oar, obj);
86  if (!success){
87  throw exc::EncodingException("Could not CN serialize given object");
88  }
89  return oss.str();
90  }
91 
92 // Crypto / encryption
93 namespace crypto {
94 namespace chacha {
95  // Constants as defined in RFC 7539.
96  const unsigned IV_SIZE = 12;
97  const unsigned TAG_SIZE = 16; // crypto_aead_chacha20poly1305_IETF_ABYTES;
98 
102  void decrypt(const void* ciphertext, size_t length, const uint8_t* key, const uint8_t* iv, char* plaintext, size_t *plaintext_len=nullptr);
103 
104 }
105 }
106 
107 
108 // Cold Key image sync
109 namespace ki {
110 
111  using ElectroneumTransferDetails = messages::electroneum::ElectroneumKeyImageSyncStepRequest_ElectroneumTransferDetails;
112  using ElectroneumSubAddressIndicesList = messages::electroneum::ElectroneumKeyImageExportInitRequest_ElectroneumSubAddressIndicesList;
113  using ElectroneumExportedKeyImage = messages::electroneum::ElectroneumKeyImageSyncStepAck_ElectroneumExportedKeyImage;
115 
119  bool key_image_data(wallet_shim * wallet,
120  const std::vector<tools::wallet2::transfer_details> & transfers,
121  std::vector<ElectroneumTransferDetails> & res);
122 
126  std::string compute_hash(const ElectroneumTransferDetails & rr);
127 
131  void generate_commitment(std::vector<ElectroneumTransferDetails> & mtds,
132  const std::vector<tools::wallet2::transfer_details> & transfers,
133  std::shared_ptr<messages::electroneum::ElectroneumKeyImageExportInitRequest> & req);
134 
140  const std::shared_ptr<messages::electroneum::ElectroneumLiveRefreshStepAck> & ack,
141  ::cryptonote::keypair& in_ephemeral,
142  ::crypto::key_image& ki);
143 }
144 
145 // Cold transaction signing
146 namespace tx {
147  using TsxData = messages::electroneum::ElectroneumTransactionInitRequest_ElectroneumTransactionData;
149  using ElectroneumAccountPublicAddress = messages::electroneum::ElectroneumTransactionDestinationEntry_ElectroneumAccountPublicAddress;
151  using ElectroneumMultisigKLRki = messages::electroneum::ElectroneumTransactionSourceEntry_ElectroneumMultisigKLRki;
152  using ElectroneumOutputEntry = messages::electroneum::ElectroneumTransactionSourceEntry_ElectroneumOutputEntry;
153  using ElectroneumRctKey = messages::electroneum::ElectroneumTransactionSourceEntry_ElectroneumOutputEntry_ElectroneumRctKeyPublic;
154  using ElectroneumRsigData = messages::electroneum::ElectroneumTransactionRsigData;
155 
158 
163  void translate_rct_key(ElectroneumRctKey * dst, const rct::ctkey * src);
164  std::string hash_addr(const ElectroneumAccountPublicAddress * addr, boost::optional<uint64_t> amount = boost::none, boost::optional<bool> is_subaddr = boost::none);
165  std::string hash_addr(const std::string & spend_key, const std::string & view_key, boost::optional<uint64_t> amount = boost::none, boost::optional<bool> is_subaddr = boost::none);
166  std::string hash_addr(const ::crypto::public_key * spend_key, const ::crypto::public_key * view_key, boost::optional<uint64_t> amount = boost::none, boost::optional<bool> is_subaddr = boost::none);
167  ::crypto::secret_key compute_enc_key(const ::crypto::secret_key & private_view_key, const std::string & aux, const std::string & salt);
168 
169  typedef boost::variant<rct::rangeSig, rct::Bulletproof> rsig_v;
170 
174  class TData {
175  public:
179  unsigned rsig_type;
181  std::vector<uint64_t> grouping_vct;
182  std::shared_ptr<ElectroneumRsigData> rsig_param;
187 
188  std::vector<std::string> tx_in_hmacs;
189  std::vector<std::string> tx_out_entr_hmacs;
190  std::vector<std::string> tx_out_hmacs;
191  std::vector<rsig_v> tx_out_rsigs;
192  std::vector<rct::ctkey> tx_out_pk;
193  std::vector<rct::ecdhTuple> tx_out_ecdh;
194  std::vector<size_t> source_permutation;
195  std::vector<std::string> alphas;
196  std::vector<std::string> spend_encs;
197  std::vector<std::string> pseudo_outs;
198  std::vector<std::string> pseudo_outs_hmac;
199  std::vector<std::string> couts;
200  std::vector<std::string> couts_dec;
201  std::vector<rct::key> rsig_gamma;
202  std::string tx_prefix_hash;
203  std::string enc_salt1;
204  std::string enc_salt2;
205  std::string enc_keys;
206 
207  std::shared_ptr<rct::rctSig> rv;
208 
209  TData();
210  };
211 
212  class Signer {
213  private:
216 
217  size_t m_tx_idx;
220 
223 
225  CHECK_AND_ASSERT_THROW_MES(m_tx_idx < m_unsigned_tx->txes.size(), "Invalid transaction index");
226  return m_unsigned_tx->txes[m_tx_idx];
227  }
228 
229  void extract_payment_id();
230  void compute_integrated_indices(TsxData * tsx_data);
231  bool should_compute_bp_now() const;
232  void compute_bproof(messages::electroneum::ElectroneumTransactionRsigData & rsig_data);
233  void process_bproof(rct::Bulletproof & bproof);
234 
235  public:
236  Signer(wallet_shim * wallet2, const unsigned_tx_set * unsigned_tx, size_t tx_idx = 0, hw::tx_aux_data * aux_data = nullptr);
237 
238  std::shared_ptr<messages::electroneum::ElectroneumTransactionInitRequest> step_init();
239  void step_init_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionInitAck> ack);
240 
241  std::shared_ptr<messages::electroneum::ElectroneumTransactionSetInputRequest> step_set_input(size_t idx);
242  void step_set_input_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionSetInputAck> ack);
243 
244  void sort_ki();
245  std::shared_ptr<messages::electroneum::ElectroneumTransactionInputsPermutationRequest> step_permutation();
246  void step_permutation_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionInputsPermutationAck> ack);
247 
248  std::shared_ptr<messages::electroneum::ElectroneumTransactionInputViniRequest> step_set_vini_input(size_t idx);
249  void step_set_vini_input_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionInputViniAck> ack);
250 
251  std::shared_ptr<messages::electroneum::ElectroneumTransactionAllInputsSetRequest> step_all_inputs_set();
252  void step_all_inputs_set_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionAllInputsSetAck> ack);
253 
254  std::shared_ptr<messages::electroneum::ElectroneumTransactionSetOutputRequest> step_set_output(size_t idx);
255  void step_set_output_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionSetOutputAck> ack);
256 
257  std::shared_ptr<messages::electroneum::ElectroneumTransactionSetOutputRequest> step_rsig(size_t idx);
258  void step_set_rsig_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionSetOutputAck> ack);
259 
260  std::shared_ptr<messages::electroneum::ElectroneumTransactionAllOutSetRequest> step_all_outs_set();
261  void step_all_outs_set_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionAllOutSetAck> ack, hw::device &hwdev);
262 
263  std::shared_ptr<messages::electroneum::ElectroneumTransactionSignInputRequest> step_sign_input(size_t idx);
264  void step_sign_input_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionSignInputAck> ack);
265 
266  std::shared_ptr<messages::electroneum::ElectroneumTransactionFinalRequest> step_final();
267  void step_final_ack(std::shared_ptr<const messages::electroneum::ElectroneumTransactionFinalAck> ack);
268 
269  std::string store_tx_aux_info();
270 
271  unsigned client_version() const {
272  return m_client_version;
273  }
274 
275  bool is_simple() const {
276  if (!m_ct.rv){
277  throw std::invalid_argument("RV not initialized");
278  }
279  auto tp = m_ct.rv->type;
280  return tp == rct::RCTTypeSimple;
281  }
282 
283  bool is_req_bulletproof() const {
285  }
286 
287  bool is_bulletproof() const {
288  if (!m_ct.rv){
289  throw std::invalid_argument("RV not initialized");
290  }
291  auto tp = m_ct.rv->type;
293  }
294 
295  bool is_offloading() const {
296  return m_ct.rsig_param && m_ct.rsig_param->offload_type() != 0;
297  }
298 
299  size_t num_outputs() const {
300  return m_ct.tx_data.splitted_dsts.size();
301  }
302 
303  size_t num_inputs() const {
304  return m_ct.tx_data.sources.size();
305  }
306 
307  const TData & tdata() const {
308  return m_ct;
309  }
310  };
311 
312  // TX Key decryption
313  void load_tx_key_data(hw::device_cold::tx_key_data_t & res, const std::string & data);
314 
315  std::shared_ptr<messages::electroneum::ElectroneumGetTxKeyRequest> get_tx_key(
316  const hw::device_cold::tx_key_data_t & tx_data);
317 
319  std::vector<::crypto::secret_key> & tx_keys,
320  const std::string & tx_prefix_hash,
321  const ::crypto::secret_key & view_key_priv,
322  std::shared_ptr<const messages::electroneum::ElectroneumGetTxKeyAck> ack
323  );
324 }
325 
326 }
327 }
328 }
329 
330 
331 #endif //ELECTRONEUM_PROTOCOL_H
#define s(x, c)
Definition: aesb.c:47
static void chacha(unsigned rounds, const void *data, size_t length, const uint8_t *key, const uint8_t *iv, char *cipher)
Definition: chacha.c:45
Definition: cryptonote_basic.h:205
std::vector< std::pair< crypto::key_image, crypto::signature > > exported_key_image
Definition: device_cold.hpp:55
Definition: device.hpp:87
Definition: exceptions.hpp:79
Definition: protocol.hpp:212
std::shared_ptr< messages::electroneum::ElectroneumTransactionSignInputRequest > step_sign_input(size_t idx)
Definition: protocol.cpp:907
void step_set_vini_input_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionInputViniAck > ack)
Definition: protocol.cpp:648
TData m_ct
Definition: protocol.hpp:214
unsigned client_version() const
Definition: protocol.hpp:271
void step_all_outs_set_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionAllOutSetAck > ack, hw::device &hwdev)
Definition: protocol.cpp:837
std::shared_ptr< messages::electroneum::ElectroneumTransactionFinalRequest > step_final()
Definition: protocol.cpp:952
std::shared_ptr< messages::electroneum::ElectroneumTransactionInitRequest > step_init()
Definition: protocol.cpp:490
Signer(wallet_shim *wallet2, const unsigned_tx_set *unsigned_tx, size_t tx_idx=0, hw::tx_aux_data *aux_data=nullptr)
Definition: protocol.cpp:380
bool should_compute_bp_now() const
Definition: protocol.cpp:769
void step_set_input_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionSetInputAck > ack)
Definition: protocol.cpp:563
void compute_bproof(messages::electroneum::ElectroneumTransactionRsigData &rsig_data)
Definition: protocol.cpp:774
bool is_offloading() const
Definition: protocol.hpp:295
void step_set_rsig_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionSetOutputAck > ack)
Definition: protocol.cpp:828
void step_init_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionInitAck > ack)
Definition: protocol.cpp:547
void sort_ki()
Definition: protocol.cpp:579
bool m_multisig
Definition: protocol.hpp:222
void process_bproof(rct::Bulletproof &bproof)
Definition: protocol.cpp:795
void step_sign_input_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionSignInputAck > ack)
Definition: protocol.cpp:930
size_t num_inputs() const
Definition: protocol.hpp:303
void extract_payment_id()
Definition: protocol.cpp:390
std::shared_ptr< messages::electroneum::ElectroneumTransactionSetOutputRequest > step_set_output(size_t idx)
Definition: protocol.cpp:684
std::shared_ptr< messages::electroneum::ElectroneumTransactionSetOutputRequest > step_rsig(size_t idx)
Definition: protocol.cpp:813
std::string store_tx_aux_info()
Definition: protocol.cpp:978
hw::tx_aux_data * m_aux_data
Definition: protocol.hpp:219
std::shared_ptr< messages::electroneum::ElectroneumTransactionInputsPermutationRequest > step_permutation()
Definition: protocol.cpp:612
void step_final_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionFinalAck > ack)
Definition: protocol.cpp:957
void step_set_output_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionSetOutputAck > ack)
Definition: protocol.cpp:708
void compute_integrated_indices(TsxData *tsx_data)
Definition: protocol.cpp:453
std::shared_ptr< messages::electroneum::ElectroneumTransactionSetInputRequest > step_set_input(size_t idx)
Definition: protocol.cpp:555
void step_all_inputs_set_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionAllInputsSetAck > ack)
Definition: protocol.cpp:656
bool is_bulletproof() const
Definition: protocol.hpp:287
const tx_construction_data & cur_tx()
Definition: protocol.hpp:224
bool is_req_bulletproof() const
Definition: protocol.hpp:283
unsigned m_client_version
Definition: protocol.hpp:221
const unsigned_tx_set * m_unsigned_tx
Definition: protocol.hpp:218
void step_permutation_ack(std::shared_ptr< const messages::electroneum::ElectroneumTransactionInputsPermutationAck > ack)
Definition: protocol.cpp:621
std::shared_ptr< messages::electroneum::ElectroneumTransactionAllOutSetRequest > step_all_outs_set()
Definition: protocol.cpp:833
size_t num_outputs() const
Definition: protocol.hpp:299
bool is_simple() const
Definition: protocol.hpp:275
std::shared_ptr< messages::electroneum::ElectroneumTransactionAllInputsSetRequest > step_all_inputs_set()
Definition: protocol.cpp:652
wallet_shim * m_wallet2
Definition: protocol.hpp:215
const TData & tdata() const
Definition: protocol.hpp:307
size_t m_tx_idx
Definition: protocol.hpp:217
std::shared_ptr< messages::electroneum::ElectroneumTransactionInputViniRequest > step_set_vini_input(size_t idx)
Definition: protocol.cpp:625
Definition: protocol.hpp:174
tx_construction_data tx_data
Definition: protocol.hpp:177
std::string enc_salt1
Definition: protocol.hpp:203
std::vector< std::string > couts
Definition: protocol.hpp:199
size_t cur_output_in_batch_idx
Definition: protocol.hpp:186
std::vector< rct::ecdhTuple > tx_out_ecdh
Definition: protocol.hpp:193
std::vector< std::string > alphas
Definition: protocol.hpp:195
size_t cur_batch_idx
Definition: protocol.hpp:185
int bp_version
Definition: protocol.hpp:180
std::string enc_salt2
Definition: protocol.hpp:204
std::vector< std::string > tx_out_hmacs
Definition: protocol.hpp:190
std::shared_ptr< ElectroneumRsigData > rsig_param
Definition: protocol.hpp:182
cryptonote::transaction tx
Definition: protocol.hpp:178
std::vector< std::string > spend_encs
Definition: protocol.hpp:196
std::vector< std::string > tx_in_hmacs
Definition: protocol.hpp:188
std::vector< uint64_t > grouping_vct
Definition: protocol.hpp:181
size_t cur_input_idx
Definition: protocol.hpp:183
std::vector< size_t > source_permutation
Definition: protocol.hpp:194
std::vector< std::string > pseudo_outs_hmac
Definition: protocol.hpp:198
unsigned rsig_type
Definition: protocol.hpp:179
TsxData tsx_data
Definition: protocol.hpp:176
std::vector< rct::key > rsig_gamma
Definition: protocol.hpp:201
std::string tx_prefix_hash
Definition: protocol.hpp:202
std::vector< std::string > couts_dec
Definition: protocol.hpp:200
std::vector< std::string > tx_out_entr_hmacs
Definition: protocol.hpp:189
std::vector< rsig_v > tx_out_rsigs
Definition: protocol.hpp:191
std::shared_ptr< rct::rctSig > rv
Definition: protocol.hpp:207
TData()
Definition: protocol.cpp:371
size_t cur_output_idx
Definition: protocol.hpp:184
std::vector< std::string > pseudo_outs
Definition: protocol.hpp:197
std::vector< rct::ctkey > tx_out_pk
Definition: protocol.hpp:192
std::string enc_keys
Definition: protocol.hpp:205
Definition: device_cold.hpp:44
expect< void > success() noexcept
Definition: expect.h:397
const uint32_t T[512]
Definition: groestl_tables.h:37
void serialize(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Definition: unordered_containers_boost_serialization.h:127
crypto namespace.
Definition: crypto.cpp:58
POD_CLASS ec_point
Definition: crypto.h:70
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:82
POD_CLASS public_key
Definition: crypto.h:76
POD_CLASS key_image
Definition: crypto.h:102
POD_CLASS ec_scalar
Definition: crypto.h:74
POD_CLASS hash
Definition: hash.h:50
void decrypt(const void *ciphertext, size_t length, const uint8_t *key, const uint8_t *iv, char *plaintext, size_t *plaintext_len)
Definition: protocol.cpp:120
const unsigned IV_SIZE
Definition: protocol.hpp:96
const unsigned TAG_SIZE
Definition: protocol.hpp:97
void live_refresh_ack(const ::crypto::secret_key &view_key_priv, const ::crypto::public_key &out_key, const std::shared_ptr< messages::Electroneum::ElectroneumLiveRefreshStepAck > &ack, ::cryptonote::keypair &in_ephemeral, ::crypto::key_image &ki)
Definition: protocol.cpp:224
hw::device_cold::exported_key_image exported_key_image
Definition: protocol.hpp:114
void generate_commitment(std::vector< ElectroneumTransferDetails > &mtds, const std::vector< tools::wallet2::transfer_details > &transfers, std::shared_ptr< messages::Electroneum::ElectroneumKeyImageExportInitRequest > &req)
Definition: protocol.cpp:188
messages::electroneum::ElectroneumKeyImageExportInitRequest_ElectroneumSubAddressIndicesList ElectroneumSubAddressIndicesList
Definition: protocol.hpp:112
messages::electroneum::ElectroneumKeyImageSyncStepRequest_ElectroneumTransferDetails ElectroneumTransferDetails
Definition: protocol.hpp:111
bool key_image_data(wallet_shim *wallet, const std::vector< tools::wallet2::transfer_details > &transfers, std::vector< ElectroneumTransferDetails > &res)
Definition: protocol.cpp:145
messages::electroneum::ElectroneumKeyImageSyncStepAck_ElectroneumExportedKeyImage ElectroneumExportedKeyImage
Definition: protocol.hpp:113
std::string compute_hash(const ElectroneumTransferDetails &rr)
Definition: protocol.cpp:167
void load_tx_key_data(hw::device_cold::tx_key_data_t &res, const std::string &data)
Definition: protocol.cpp:1007
messages::electroneum::ElectroneumTransactionSourceEntry_ElectroneumOutputEntry_ElectroneumRctKeyPublic ElectroneumRctKey
Definition: protocol.hpp:153
void translate_klrki(ElectroneumMultisigKLRki *dst, const rct::multisig_kLRki *src)
Definition: protocol.cpp:305
messages::electroneum::ElectroneumTransactionSourceEntry_ElectroneumMultisigKLRki ElectroneumMultisigKLRki
Definition: protocol.hpp:151
std::shared_ptr< messages::Electroneum::ElectroneumGetTxKeyRequest > get_tx_key(const hw::device_cold::tx_key_data_t &tx_data)
Definition: protocol.cpp:1038
std::string hash_addr(const ElectroneumAccountPublicAddress *addr, boost::optional< uint64_t > amount, boost::optional< bool > is_subaddr)
Definition: protocol.cpp:317
messages::electroneum::ElectroneumTransactionDestinationEntry_ElectroneumAccountPublicAddress ElectroneumAccountPublicAddress
Definition: protocol.hpp:149
messages::electroneum::ElectroneumTransactionSourceEntry ElectroneumTransactionSourceEntry
Definition: protocol.hpp:150
tools::wallet2::tx_construction_data tx_construction_data
Definition: protocol.hpp:156
messages::electroneum::ElectroneumTransactionSourceEntry_ElectroneumOutputEntry ElectroneumOutputEntry
Definition: protocol.hpp:152
tools::wallet2::unsigned_tx_set unsigned_tx_set
Definition: protocol.hpp:157
messages::electroneum::ElectroneumTransactionInitRequest_ElectroneumTransactionData TsxData
Definition: protocol.hpp:147
void get_tx_key_ack(std::vector<::crypto::secret_key > &tx_keys, const std::string &tx_prefix_hash, const ::crypto::secret_key &view_key_priv, std::shared_ptr< const messages::Electroneum::ElectroneumGetTxKeyAck > ack)
Definition: protocol.cpp:1051
::crypto::secret_key compute_enc_key(const ::crypto::secret_key &private_view_key, const std::string &aux, const std::string &salt)
Definition: protocol.cpp:351
void translate_src_entry(ElectroneumTransactionSourceEntry *dst, const cryptonote::tx_source_entry *src)
Definition: protocol.cpp:285
void translate_dst_entry(ElectroneumTransactionDestinationEntry *dst, const cryptonote::tx_destination_entry *src)
Definition: protocol.cpp:277
void translate_rct_key(ElectroneumRctKey *dst, const rct::ctkey *src)
Definition: protocol.cpp:312
boost::variant< rct::rangeSig, rct::Bulletproof > rsig_v
Definition: protocol.hpp:169
messages::electroneum::ElectroneumTransactionDestinationEntry ElectroneumTransactionDestinationEntry
Definition: protocol.hpp:148
void translate_address(ElectroneumAccountPublicAddress *dst, const cryptonote::account_public_address *src)
Definition: protocol.cpp:272
messages::electroneum::ElectroneumTransactionRsigData ElectroneumRsigData
Definition: protocol.hpp:154
void assign_from_repeatable(std::vector< sub_t > *dst, const InputIterator begin, const InputIterator end)
Definition: protocol.hpp:61
bool cn_deserialize(const void *buff, size_t len, T &dst)
Definition: protocol.hpp:68
void string_to_key(::crypto::ec_scalar &key, const std::string &str)
Definition: protocol.cpp:96
void assign_to_repeatable(::google::protobuf::RepeatedField< sub_t > *dst, const InputIterator begin, const InputIterator end)
Definition: protocol.hpp:53
std::string key_to_string(const ::crypto::ec_point &key)
Definition: protocol.cpp:80
std::string cn_serialize(T &obj)
Definition: protocol.hpp:82
Definition: device.cpp:38
@ RCTTypeSimple
Definition: rctTypes.h:231
@ RCTTypeBulletproof2
Definition: rctTypes.h:233
@ RCTTypeBulletproof
Definition: rctTypes.h:232
@ RangeProofBorromean
Definition: rctTypes.h:235
static const unsigned char iv[64]
Definition: sha512-hash.c:13
Definition: binary_archive.h:99
Definition: binary_archive.h:182
Definition: cryptonote_basic.h:453
Definition: cryptonote_basic.h:480
Definition: cryptonote_tx_utils.h:76
Definition: cryptonote_tx_utils.h:44
Definition: device_cold.hpp:97
Definition: device_cold.hpp:40
Definition: rctTypes.h:180
RangeProofType range_proof_type
Definition: rctTypes.h:237
Definition: rctTypes.h:96
Definition: rctTypes.h:78
Definition: rctTypes.h:104
Definition: wallet2.h:406
std::vector< cryptonote::tx_source_entry > sources
Definition: wallet2.h:407
std::vector< cryptonote::tx_destination_entry > splitted_dsts
Definition: wallet2.h:409
rct::RCTConfig rct_config
Definition: wallet2.h:414
Definition: wallet2.h:483
std::vector< tx_construction_data > txes
Definition: wallet2.h:484