Monero
protocol.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017-2020, The Monero 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 MONERO_PROTOCOL_H
31 #define MONERO_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 MoneroTransferDetails = messages::monero::MoneroKeyImageSyncStepRequest_MoneroTransferDetails;
112  using MoneroSubAddressIndicesList = messages::monero::MoneroKeyImageExportInitRequest_MoneroSubAddressIndicesList;
113  using MoneroExportedKeyImage = messages::monero::MoneroKeyImageSyncStepAck_MoneroExportedKeyImage;
115 
119  bool key_image_data(wallet_shim * wallet,
120  const std::vector<tools::wallet2::transfer_details> & transfers,
121  std::vector<MoneroTransferDetails> & res,
122  bool need_all_additionals=false);
123 
127  std::string compute_hash(const MoneroTransferDetails & rr);
128 
132  void generate_commitment(std::vector<MoneroTransferDetails> & mtds,
133  const std::vector<tools::wallet2::transfer_details> & transfers,
134  std::shared_ptr<messages::monero::MoneroKeyImageExportInitRequest> & req,
135  bool need_subaddr_indices=false);
136 
140  void live_refresh_ack(const ::crypto::secret_key & view_key_priv,
142  const std::shared_ptr<messages::monero::MoneroLiveRefreshStepAck> & ack,
143  ::cryptonote::keypair& in_ephemeral,
144  ::crypto::key_image& ki);
145 }
146 
147 // Cold transaction signing
148 namespace tx {
149  using TsxData = messages::monero::MoneroTransactionInitRequest_MoneroTransactionData;
151  using MoneroAccountPublicAddress = messages::monero::MoneroTransactionDestinationEntry_MoneroAccountPublicAddress;
153  using MoneroMultisigKLRki = messages::monero::MoneroTransactionSourceEntry_MoneroMultisigKLRki;
154  using MoneroOutputEntry = messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry;
155  using MoneroRctKey = messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry_MoneroRctKeyPublic;
156  using MoneroRsigData = messages::monero::MoneroTransactionRsigData;
157 
160 
164  void translate_rct_key(MoneroRctKey * dst, const rct::ctkey * src);
165  std::string hash_addr(const MoneroAccountPublicAddress * addr, boost::optional<uint64_t> amount = boost::none, boost::optional<bool> is_subaddr = boost::none);
166  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);
167  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);
168  ::crypto::secret_key compute_enc_key(const ::crypto::secret_key & private_view_key, const std::string & aux, const std::string & salt);
169  std::string compute_sealing_key(const std::string & master_key, size_t idx, bool is_iv=false);
170 
171  typedef boost::variant<rct::rangeSig, rct::Bulletproof> rsig_v;
172 
176  class TData {
177  public:
181  unsigned rsig_type;
183  std::vector<uint64_t> grouping_vct;
184  std::shared_ptr<MoneroRsigData> rsig_param;
189 
190  std::vector<std::string> tx_in_hmacs;
191  std::vector<std::string> tx_out_entr_hmacs;
192  std::vector<std::string> tx_out_hmacs;
193  std::vector<rsig_v> tx_out_rsigs;
194  std::vector<rct::ctkey> tx_out_pk;
195  std::vector<rct::ecdhTuple> tx_out_ecdh;
196  std::vector<size_t> source_permutation;
197  std::vector<std::string> alphas;
198  std::vector<std::string> spend_encs;
199  std::vector<std::string> pseudo_outs;
200  std::vector<std::string> pseudo_outs_hmac;
201  std::vector<std::string> couts;
202  std::vector<std::string> couts_dec;
203  std::vector<std::string> signatures;
204  std::vector<rct::key> rsig_gamma;
205  std::string tx_prefix_hash;
206  std::string enc_salt1;
207  std::string enc_salt2;
208  std::string enc_keys;
209 
210  std::shared_ptr<rct::rctSig> rv;
211 
212  TData();
213  };
214 
215  class Signer {
216  private:
219 
220  size_t m_tx_idx;
223 
226 
228  CHECK_AND_ASSERT_THROW_MES(m_tx_idx < m_unsigned_tx->txes.size(), "Invalid transaction index");
229  return m_unsigned_tx->txes[m_tx_idx];
230  }
231 
232  const tx_construction_data & cur_tx() const {
233  return m_ct.tx_data;
234  }
235 
236  const tools::wallet2::transfer_details & get_transfer(size_t idx) const {
237  CHECK_AND_ASSERT_THROW_MES(idx < m_unsigned_tx->transfers.second.size() + m_unsigned_tx->transfers.first && idx >= m_unsigned_tx->transfers.first, "Invalid transfer index");
238  return m_unsigned_tx->transfers.second[idx - m_unsigned_tx->transfers.first];
239  }
240 
242  const auto & sel_transfers = cur_tx().selected_transfers;
243  CHECK_AND_ASSERT_THROW_MES(idx < m_ct.source_permutation.size(), "Invalid source index - permutation");
244  CHECK_AND_ASSERT_THROW_MES(m_ct.source_permutation[idx] < sel_transfers.size(), "Invalid source index");
245  return get_transfer(sel_transfers.at(m_ct.source_permutation[idx]));
246  }
247 
248  void extract_payment_id();
249  void compute_integrated_indices(TsxData * tsx_data);
250  bool should_compute_bp_now() const;
251  void compute_bproof(messages::monero::MoneroTransactionRsigData & rsig_data);
252  void process_bproof(rct::Bulletproof & bproof);
253  void set_tx_input(MoneroTransactionSourceEntry * dst, size_t idx, bool need_ring_keys=false, bool need_ring_indices=false);
254 
255  public:
256  Signer(wallet_shim * wallet2, const unsigned_tx_set * unsigned_tx, size_t tx_idx = 0, hw::tx_aux_data * aux_data = nullptr);
257 
258  std::shared_ptr<messages::monero::MoneroTransactionInitRequest> step_init();
259  void step_init_ack(std::shared_ptr<const messages::monero::MoneroTransactionInitAck> ack);
260 
261  std::shared_ptr<messages::monero::MoneroTransactionSetInputRequest> step_set_input(size_t idx);
262  void step_set_input_ack(std::shared_ptr<const messages::monero::MoneroTransactionSetInputAck> ack);
263 
264  void sort_ki();
265  std::shared_ptr<messages::monero::MoneroTransactionInputsPermutationRequest> step_permutation();
266  void step_permutation_ack(std::shared_ptr<const messages::monero::MoneroTransactionInputsPermutationAck> ack);
267 
268  std::shared_ptr<messages::monero::MoneroTransactionInputViniRequest> step_set_vini_input(size_t idx);
269  void step_set_vini_input_ack(std::shared_ptr<const messages::monero::MoneroTransactionInputViniAck> ack);
270 
271  std::shared_ptr<messages::monero::MoneroTransactionAllInputsSetRequest> step_all_inputs_set();
272  void step_all_inputs_set_ack(std::shared_ptr<const messages::monero::MoneroTransactionAllInputsSetAck> ack);
273 
274  std::shared_ptr<messages::monero::MoneroTransactionSetOutputRequest> step_set_output(size_t idx);
275  void step_set_output_ack(std::shared_ptr<const messages::monero::MoneroTransactionSetOutputAck> ack);
276 
277  std::shared_ptr<messages::monero::MoneroTransactionSetOutputRequest> step_rsig(size_t idx);
278  void step_set_rsig_ack(std::shared_ptr<const messages::monero::MoneroTransactionSetOutputAck> ack);
279 
280  std::shared_ptr<messages::monero::MoneroTransactionAllOutSetRequest> step_all_outs_set();
281  void step_all_outs_set_ack(std::shared_ptr<const messages::monero::MoneroTransactionAllOutSetAck> ack, hw::device &hwdev);
282 
283  std::shared_ptr<messages::monero::MoneroTransactionSignInputRequest> step_sign_input(size_t idx);
284  void step_sign_input_ack(std::shared_ptr<const messages::monero::MoneroTransactionSignInputAck> ack);
285 
286  std::shared_ptr<messages::monero::MoneroTransactionFinalRequest> step_final();
287  void step_final_ack(std::shared_ptr<const messages::monero::MoneroTransactionFinalAck> ack);
288 
289  std::string store_tx_aux_info();
290 
291  unsigned client_version() const {
292  return m_client_version;
293  }
294 
295  bool is_simple() const {
296  if (!m_ct.rv){
297  throw std::invalid_argument("RV not initialized");
298  }
299  auto tp = m_ct.rv->type;
300  return tp == rct::RCTTypeSimple;
301  }
302 
303  bool is_req_bulletproof() const {
305  }
306 
307  bool is_bulletproof() const {
308  if (!m_ct.rv){
309  throw std::invalid_argument("RV not initialized");
310  }
311  auto tp = m_ct.rv->type;
313  }
314 
315  bool is_offloading() const {
316  return m_ct.rsig_param && m_ct.rsig_param->offload_type() != 0;
317  }
318 
319  size_t num_outputs() const {
320  return m_ct.tx_data.splitted_dsts.size();
321  }
322 
323  size_t num_inputs() const {
324  return m_ct.tx_data.sources.size();
325  }
326 
327  const TData & tdata() const {
328  return m_ct;
329  }
330  };
331 
332  // TX Key decryption
333  void load_tx_key_data(hw::device_cold::tx_key_data_t & res, const std::string & data);
334 
335  std::shared_ptr<messages::monero::MoneroGetTxKeyRequest> get_tx_key(
336  const hw::device_cold::tx_key_data_t & tx_data);
337 
338  void get_tx_key_ack(
339  std::vector<::crypto::secret_key> & tx_keys,
340  const std::string & tx_prefix_hash,
341  const ::crypto::secret_key & view_key_priv,
342  std::shared_ptr<const messages::monero::MoneroGetTxKeyAck> ack
343  );
344 }
345 
346 }
347 }
348 }
349 
350 
351 #endif //MONERO_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:194
std::vector< std::pair< crypto::key_image, crypto::signature > > exported_key_image
Definition: device_cold.hpp:56
Definition: device.hpp:87
Definition: exceptions.hpp:79
Definition: protocol.hpp:215
const tx_construction_data & cur_src_tx() const
Definition: protocol.hpp:227
std::shared_ptr< messages::monero::MoneroTransactionFinalRequest > step_final()
Definition: protocol.cpp:967
const tools::wallet2::transfer_details & get_source_transfer(size_t idx) const
Definition: protocol.hpp:241
TData m_ct
Definition: protocol.hpp:217
unsigned client_version() const
Definition: protocol.hpp:291
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:396
bool should_compute_bp_now() const
Definition: protocol.cpp:788
bool is_offloading() const
Definition: protocol.hpp:315
void set_tx_input(MoneroTransactionSourceEntry *dst, size_t idx, bool need_ring_keys=false, bool need_ring_indices=false)
Definition: protocol.cpp:469
void step_permutation_ack(std::shared_ptr< const messages::monero::MoneroTransactionInputsPermutationAck > ack)
Definition: protocol.cpp:681
void step_set_rsig_ack(std::shared_ptr< const messages::monero::MoneroTransactionSetOutputAck > ack)
Definition: protocol.cpp:847
void sort_ki()
Definition: protocol.cpp:641
std::shared_ptr< messages::monero::MoneroTransactionSetInputRequest > step_set_input(size_t idx)
Definition: protocol.cpp:617
bool m_multisig
Definition: protocol.hpp:225
std::shared_ptr< messages::monero::MoneroTransactionInputsPermutationRequest > step_permutation()
Definition: protocol.cpp:669
void process_bproof(rct::Bulletproof &bproof)
Definition: protocol.cpp:814
size_t num_inputs() const
Definition: protocol.hpp:323
void extract_payment_id()
Definition: protocol.cpp:406
std::shared_ptr< messages::monero::MoneroTransactionAllInputsSetRequest > step_all_inputs_set()
Definition: protocol.cpp:705
void step_all_outs_set_ack(std::shared_ptr< const messages::monero::MoneroTransactionAllOutSetAck > ack, hw::device &hwdev)
Definition: protocol.cpp:856
std::string store_tx_aux_info()
Definition: protocol.cpp:1038
hw::tx_aux_data * m_aux_data
Definition: protocol.hpp:222
void step_set_output_ack(std::shared_ptr< const messages::monero::MoneroTransactionSetOutputAck > ack)
Definition: protocol.cpp:727
void step_sign_input_ack(std::shared_ptr< const messages::monero::MoneroTransactionSignInputAck > ack)
Definition: protocol.cpp:950
void step_all_inputs_set_ack(std::shared_ptr< const messages::monero::MoneroTransactionAllInputsSetAck > ack)
Definition: protocol.cpp:709
std::shared_ptr< messages::monero::MoneroTransactionInputViniRequest > step_set_vini_input(size_t idx)
Definition: protocol.cpp:685
void compute_integrated_indices(TsxData *tsx_data)
Definition: protocol.cpp:504
void step_set_input_ack(std::shared_ptr< const messages::monero::MoneroTransactionSetInputAck > ack)
Definition: protocol.cpp:625
void step_init_ack(std::shared_ptr< const messages::monero::MoneroTransactionInitAck > ack)
Definition: protocol.cpp:609
bool is_bulletproof() const
Definition: protocol.hpp:307
std::shared_ptr< messages::monero::MoneroTransactionSetOutputRequest > step_set_output(size_t idx)
Definition: protocol.cpp:712
std::shared_ptr< messages::monero::MoneroTransactionSignInputRequest > step_sign_input(size_t idx)
Definition: protocol.cpp:926
bool is_req_bulletproof() const
Definition: protocol.hpp:303
const tx_construction_data & cur_tx() const
Definition: protocol.hpp:232
void step_final_ack(std::shared_ptr< const messages::monero::MoneroTransactionFinalAck > ack)
Definition: protocol.cpp:971
unsigned m_client_version
Definition: protocol.hpp:224
const unsigned_tx_set * m_unsigned_tx
Definition: protocol.hpp:221
std::shared_ptr< messages::monero::MoneroTransactionAllOutSetRequest > step_all_outs_set()
Definition: protocol.cpp:852
const tools::wallet2::transfer_details & get_transfer(size_t idx) const
Definition: protocol.hpp:236
size_t num_outputs() const
Definition: protocol.hpp:319
std::shared_ptr< messages::monero::MoneroTransactionInitRequest > step_init()
Definition: protocol.cpp:541
void compute_bproof(messages::monero::MoneroTransactionRsigData &rsig_data)
Definition: protocol.cpp:793
bool is_simple() const
Definition: protocol.hpp:295
void step_set_vini_input_ack(std::shared_ptr< const messages::monero::MoneroTransactionInputViniAck > ack)
Definition: protocol.cpp:701
std::shared_ptr< messages::monero::MoneroTransactionSetOutputRequest > step_rsig(size_t idx)
Definition: protocol.cpp:832
wallet_shim * m_wallet2
Definition: protocol.hpp:218
const TData & tdata() const
Definition: protocol.hpp:327
size_t m_tx_idx
Definition: protocol.hpp:220
Definition: protocol.hpp:176
tx_construction_data tx_data
Definition: protocol.hpp:179
std::string enc_salt1
Definition: protocol.hpp:206
std::vector< std::string > couts
Definition: protocol.hpp:201
size_t cur_output_in_batch_idx
Definition: protocol.hpp:188
std::vector< rct::ecdhTuple > tx_out_ecdh
Definition: protocol.hpp:195
std::vector< std::string > alphas
Definition: protocol.hpp:197
size_t cur_batch_idx
Definition: protocol.hpp:187
int bp_version
Definition: protocol.hpp:182
std::string enc_salt2
Definition: protocol.hpp:207
std::vector< std::string > tx_out_hmacs
Definition: protocol.hpp:192
cryptonote::transaction tx
Definition: protocol.hpp:180
std::vector< std::string > spend_encs
Definition: protocol.hpp:198
std::vector< std::string > tx_in_hmacs
Definition: protocol.hpp:190
std::vector< std::string > signatures
Definition: protocol.hpp:203
std::vector< uint64_t > grouping_vct
Definition: protocol.hpp:183
size_t cur_input_idx
Definition: protocol.hpp:185
std::vector< size_t > source_permutation
Definition: protocol.hpp:196
std::vector< std::string > pseudo_outs_hmac
Definition: protocol.hpp:200
unsigned rsig_type
Definition: protocol.hpp:181
TsxData tsx_data
Definition: protocol.hpp:178
std::vector< rct::key > rsig_gamma
Definition: protocol.hpp:204
std::string tx_prefix_hash
Definition: protocol.hpp:205
std::shared_ptr< MoneroRsigData > rsig_param
Definition: protocol.hpp:184
std::vector< std::string > couts_dec
Definition: protocol.hpp:202
std::vector< std::string > tx_out_entr_hmacs
Definition: protocol.hpp:191
std::vector< rsig_v > tx_out_rsigs
Definition: protocol.hpp:193
std::shared_ptr< rct::rctSig > rv
Definition: protocol.hpp:210
TData()
Definition: protocol.cpp:387
size_t cur_output_idx
Definition: protocol.hpp:186
std::vector< std::string > pseudo_outs
Definition: protocol.hpp:199
std::vector< rct::ctkey > tx_out_pk
Definition: protocol.hpp:194
std::string enc_keys
Definition: protocol.hpp:208
Definition: device_cold.hpp:44
expect< void > success() noexcept
Definition: expect.h:397
const uint32_t T[512]
Definition: groestl_tables.h:36
void serialize(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Definition: unordered_containers_boost_serialization.h:126
crypto namespace.
Definition: crypto.cpp:60
POD_CLASS ec_point
Definition: crypto.h:55
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:67
POD_CLASS public_key
Definition: crypto.h:61
POD_CLASS key_image
Definition: crypto.h:87
POD_CLASS ec_scalar
Definition: crypto.h:59
POD_CLASS hash
Definition: hash.h:48
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:121
const unsigned IV_SIZE
Definition: protocol.hpp:96
const unsigned TAG_SIZE
Definition: protocol.hpp:97
messages::monero::MoneroKeyImageSyncStepAck_MoneroExportedKeyImage MoneroExportedKeyImage
Definition: protocol.hpp:113
void generate_commitment(std::vector< MoneroTransferDetails > &mtds, const std::vector< tools::wallet2::transfer_details > &transfers, std::shared_ptr< messages::monero::MoneroKeyImageExportInitRequest > &req, bool need_subaddr_indices)
Definition: protocol.cpp:196
hw::device_cold::exported_key_image exported_key_image
Definition: protocol.hpp:114
messages::monero::MoneroKeyImageSyncStepRequest_MoneroTransferDetails MoneroTransferDetails
Definition: protocol.hpp:111
void live_refresh_ack(const ::crypto::secret_key &view_key_priv, const ::crypto::public_key &out_key, const std::shared_ptr< messages::monero::MoneroLiveRefreshStepAck > &ack, ::cryptonote::keypair &in_ephemeral, ::crypto::key_image &ki)
Definition: protocol.cpp:235
messages::monero::MoneroKeyImageExportInitRequest_MoneroSubAddressIndicesList MoneroSubAddressIndicesList
Definition: protocol.hpp:112
std::string compute_hash(const MoneroTransferDetails &rr)
Definition: protocol.cpp:175
bool key_image_data(wallet_shim *wallet, const std::vector< tools::wallet2::transfer_details > &transfers, std::vector< MoneroTransferDetails > &res, bool need_all_additionals)
Definition: protocol.cpp:146
void load_tx_key_data(hw::device_cold::tx_key_data_t &res, const std::string &data)
Definition: protocol.cpp:1067
messages::monero::MoneroTransactionRsigData MoneroRsigData
Definition: protocol.hpp:156
messages::monero::MoneroTransactionInitRequest_MoneroTransactionData TsxData
Definition: protocol.hpp:149
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::monero::MoneroGetTxKeyAck > ack)
Definition: protocol.cpp:1111
void translate_dst_entry(MoneroTransactionDestinationEntry *dst, const cryptonote::tx_destination_entry *src)
Definition: protocol.cpp:288
void translate_klrki(MoneroMultisigKLRki *dst, const rct::multisig_kLRki *src)
Definition: protocol.cpp:296
tools::wallet2::tx_construction_data tx_construction_data
Definition: protocol.hpp:158
messages::monero::MoneroTransactionDestinationEntry_MoneroAccountPublicAddress MoneroAccountPublicAddress
Definition: protocol.hpp:151
void translate_rct_key(MoneroRctKey *dst, const rct::ctkey *src)
Definition: protocol.cpp:303
std::string hash_addr(const MoneroAccountPublicAddress *addr, boost::optional< uint64_t > amount, boost::optional< bool > is_subaddr)
Definition: protocol.cpp:308
tools::wallet2::unsigned_tx_set unsigned_tx_set
Definition: protocol.hpp:159
std::shared_ptr< messages::monero::MoneroGetTxKeyRequest > get_tx_key(const hw::device_cold::tx_key_data_t &tx_data)
Definition: protocol.cpp:1098
::crypto::secret_key compute_enc_key(const ::crypto::secret_key &private_view_key, const std::string &aux, const std::string &salt)
Definition: protocol.cpp:342
messages::monero::MoneroTransactionSourceEntry MoneroTransactionSourceEntry
Definition: protocol.hpp:152
void translate_address(MoneroAccountPublicAddress *dst, const cryptonote::account_public_address *src)
Definition: protocol.cpp:283
messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry_MoneroRctKeyPublic MoneroRctKey
Definition: protocol.hpp:155
boost::variant< rct::rangeSig, rct::Bulletproof > rsig_v
Definition: protocol.hpp:171
messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry MoneroOutputEntry
Definition: protocol.hpp:154
messages::monero::MoneroTransactionDestinationEntry MoneroTransactionDestinationEntry
Definition: protocol.hpp:150
messages::monero::MoneroTransactionSourceEntry_MoneroMultisigKLRki MoneroMultisigKLRki
Definition: protocol.hpp:153
std::string compute_sealing_key(const std::string &master_key, size_t idx, bool is_iv)
Definition: protocol.cpp:362
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:97
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:81
std::string cn_serialize(T &obj)
Definition: protocol.hpp:82
Definition: device.cpp:38
@ RCTTypeSimple
Definition: rctTypes.h:256
@ RCTTypeCLSAG
Definition: rctTypes.h:259
@ RCTTypeBulletproof2
Definition: rctTypes.h:258
@ RCTTypeBulletproof
Definition: rctTypes.h:257
@ RangeProofBorromean
Definition: rctTypes.h:261
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:501
Definition: cryptonote_basic.h:528
Definition: cryptonote_tx_utils.h:75
Definition: device_cold.hpp:98
Definition: device_cold.hpp:40
Definition: rctTypes.h:205
RangeProofType range_proof_type
Definition: rctTypes.h:263
Definition: rctTypes.h:97
Definition: rctTypes.h:79
Definition: rctTypes.h:105
Definition: wallet2.h:326
Definition: wallet2.h:489
std::vector< cryptonote::tx_source_entry > sources
Definition: wallet2.h:490
std::vector< cryptonote::tx_destination_entry > splitted_dsts
Definition: wallet2.h:492
rct::RCTConfig rct_config
Definition: wallet2.h:497
std::vector< size_t > selected_transfers
Definition: wallet2.h:493
Definition: wallet2.h:575
std::vector< tx_construction_data > txes
Definition: wallet2.h:576
std::pair< size_t, wallet2::transfer_container > transfers
Definition: wallet2.h:577