Monero
protocol.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017-2022, 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 
47 
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  binary_archive<false> ba{{reinterpret_cast<const std::uint8_t*>(buff), len}};
70  bool r = ::serialization::serialize(ba, dst);
71  return r;
72  }
73 
74  template<typename T>
75  bool cn_deserialize(const std::string & str, T & dst){
76  return cn_deserialize(str.data(), str.size(), dst);
77  }
78 
79  template<typename T>
81  std::ostringstream oss;
82  binary_archive<true> oar(oss);
83  bool success = ::serialization::serialize(oar, obj);
84  if (!success){
85  throw exc::EncodingException("Could not CN serialize given object");
86  }
87  return oss.str();
88  }
89 
90 // Crypto / encryption
91 namespace crypto {
92 namespace chacha {
93  // Constants as defined in RFC 7539.
94  const unsigned IV_SIZE = 12;
95  const unsigned TAG_SIZE = 16; // crypto_aead_chacha20poly1305_IETF_ABYTES;
96 
100  void decrypt(const void* ciphertext, size_t length, const uint8_t* key, const uint8_t* iv, char* plaintext, size_t *plaintext_len=nullptr);
101 
102 }
103 }
104 
105 
106 // Cold Key image sync
107 namespace ki {
108 
109  using MoneroTransferDetails = messages::monero::MoneroKeyImageSyncStepRequest_MoneroTransferDetails;
110  using MoneroSubAddressIndicesList = messages::monero::MoneroKeyImageExportInitRequest_MoneroSubAddressIndicesList;
111  using MoneroExportedKeyImage = messages::monero::MoneroKeyImageSyncStepAck_MoneroExportedKeyImage;
113 
118  const std::vector<tools::wallet2::transfer_details> & transfers,
119  std::vector<MoneroTransferDetails> & res);
120 
125 
129  void generate_commitment(std::vector<MoneroTransferDetails> & mtds,
130  const std::vector<tools::wallet2::transfer_details> & transfers,
131  std::shared_ptr<messages::monero::MoneroKeyImageExportInitRequest> & req);
132 
136  void live_refresh_ack(const ::crypto::secret_key & view_key_priv,
138  const std::shared_ptr<messages::monero::MoneroLiveRefreshStepAck> & ack,
139  ::cryptonote::keypair& in_ephemeral,
140  ::crypto::key_image& ki);
141 }
142 
143 // Cold transaction signing
144 namespace tx {
145  using TsxData = messages::monero::MoneroTransactionInitRequest_MoneroTransactionData;
147  using MoneroAccountPublicAddress = messages::monero::MoneroTransactionDestinationEntry_MoneroAccountPublicAddress;
149  using MoneroMultisigKLRki = messages::monero::MoneroTransactionSourceEntry_MoneroMultisigKLRki;
150  using MoneroOutputEntry = messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry;
151  using MoneroRctKey = messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry_MoneroRctKeyPublic;
152  using MoneroRsigData = messages::monero::MoneroTransactionRsigData;
153 
156 
160  void translate_rct_key(MoneroRctKey * dst, const rct::ctkey * src);
161  std::string hash_addr(const MoneroAccountPublicAddress * addr, boost::optional<uint64_t> amount = boost::none, boost::optional<bool> is_subaddr = boost::none);
162  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);
163  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);
164  ::crypto::secret_key compute_enc_key(const ::crypto::secret_key & private_view_key, const std::string & aux, const std::string & salt);
165  std::string compute_sealing_key(const std::string & master_key, size_t idx, bool is_iv=false);
166 
167  typedef boost::variant<rct::Bulletproof, rct::BulletproofPlus> rsig_v;
168 
172  class TData {
173  public:
177  unsigned rsig_type;
179  std::vector<uint64_t> grouping_vct;
180  std::shared_ptr<MoneroRsigData> rsig_param;
185 
186  std::vector<std::string> tx_in_hmacs;
187  std::vector<std::string> tx_out_entr_hmacs;
188  std::vector<std::string> tx_out_hmacs;
189  std::vector<rsig_v> tx_out_rsigs;
190  std::vector<rct::ctkey> tx_out_pk;
191  std::vector<rct::ecdhTuple> tx_out_ecdh;
192  std::vector<size_t> source_permutation;
193  std::vector<std::string> alphas;
194  std::vector<std::string> spend_encs;
195  std::vector<std::string> pseudo_outs;
196  std::vector<std::string> pseudo_outs_hmac;
197  std::vector<std::string> couts;
198  std::vector<std::string> couts_dec;
199  std::vector<std::string> signatures;
200  std::vector<rct::key> rsig_gamma;
205 
206  std::shared_ptr<rct::rctSig> rv;
207 
208  TData();
209  };
210 
211  class Signer {
212  private:
215 
216  size_t m_tx_idx;
219 
222 
224  CHECK_AND_ASSERT_THROW_MES(m_tx_idx < m_unsigned_tx->txes.size(), "Invalid transaction index");
225  return m_unsigned_tx->txes[m_tx_idx];
226  }
227 
228  const tx_construction_data & cur_tx() const {
229  return m_ct.tx_data;
230  }
231 
232  const tools::wallet2::transfer_details & get_transfer(size_t idx) const {
233  CHECK_AND_ASSERT_THROW_MES(idx < std::get<2>(m_unsigned_tx->transfers).size() + std::get<0>(m_unsigned_tx->transfers) && idx >= std::get<0>(m_unsigned_tx->transfers), "Invalid transfer index");
234  return std::get<2>(m_unsigned_tx->transfers)[idx - std::get<0>(m_unsigned_tx->transfers)];
235  }
236 
238  const auto & sel_transfers = cur_tx().selected_transfers;
239  CHECK_AND_ASSERT_THROW_MES(idx < m_ct.source_permutation.size(), "Invalid source index - permutation");
240  CHECK_AND_ASSERT_THROW_MES(m_ct.source_permutation[idx] < sel_transfers.size(), "Invalid source index");
241  return get_transfer(sel_transfers.at(m_ct.source_permutation[idx]));
242  }
243 
244  void extract_payment_id();
245  void compute_integrated_indices(TsxData * tsx_data);
246  bool should_compute_bp_now() const;
247  void compute_bproof(messages::monero::MoneroTransactionRsigData & rsig_data);
248  void process_bproof(rsig_v & bproof);
249  void set_tx_input(MoneroTransactionSourceEntry * dst, size_t idx, bool need_ring_keys=false, bool need_ring_indices=false);
250 
251  public:
252  Signer(wallet_shim * wallet2, const unsigned_tx_set * unsigned_tx, size_t tx_idx = 0, hw::tx_aux_data * aux_data = nullptr);
253 
254  std::shared_ptr<messages::monero::MoneroTransactionInitRequest> step_init();
255  void step_init_ack(std::shared_ptr<const messages::monero::MoneroTransactionInitAck> ack);
256 
257  std::shared_ptr<messages::monero::MoneroTransactionSetInputRequest> step_set_input(size_t idx);
258  void step_set_input_ack(std::shared_ptr<const messages::monero::MoneroTransactionSetInputAck> ack);
259 
260  void sort_ki();
261 
262  std::shared_ptr<messages::monero::MoneroTransactionInputViniRequest> step_set_vini_input(size_t idx);
263  void step_set_vini_input_ack(std::shared_ptr<const messages::monero::MoneroTransactionInputViniAck> ack);
264 
265  std::shared_ptr<messages::monero::MoneroTransactionAllInputsSetRequest> step_all_inputs_set();
266  void step_all_inputs_set_ack(std::shared_ptr<const messages::monero::MoneroTransactionAllInputsSetAck> ack);
267 
268  std::shared_ptr<messages::monero::MoneroTransactionSetOutputRequest> step_set_output(size_t idx);
269  void step_set_output_ack(std::shared_ptr<const messages::monero::MoneroTransactionSetOutputAck> ack);
270 
271  std::shared_ptr<messages::monero::MoneroTransactionSetOutputRequest> step_rsig(size_t idx);
272  void step_set_rsig_ack(std::shared_ptr<const messages::monero::MoneroTransactionSetOutputAck> ack);
273 
274  std::shared_ptr<messages::monero::MoneroTransactionAllOutSetRequest> step_all_outs_set();
275  void step_all_outs_set_ack(std::shared_ptr<const messages::monero::MoneroTransactionAllOutSetAck> ack, hw::device &hwdev);
276 
277  std::shared_ptr<messages::monero::MoneroTransactionSignInputRequest> step_sign_input(size_t idx);
278  void step_sign_input_ack(std::shared_ptr<const messages::monero::MoneroTransactionSignInputAck> ack);
279 
280  std::shared_ptr<messages::monero::MoneroTransactionFinalRequest> step_final();
281  void step_final_ack(std::shared_ptr<const messages::monero::MoneroTransactionFinalAck> ack);
282 
284 
285  unsigned client_version() const {
286  return m_client_version;
287  }
288 
290  if (!m_ct.rv){
291  throw std::invalid_argument("RV not initialized");
292  }
293  return m_ct.rv->type;
294  }
295 
296  bool is_simple() const {
297  auto tp = get_rv_type();
298  return tp == rct::RCTTypeSimple;
299  }
300 
301  bool is_req_bulletproof() const {
303  }
304 
305  bool is_req_clsag() const {
307  }
308 
309  bool is_req_bulletproof_plus() const {
310  return is_req_bulletproof() && m_ct.tx_data.rct_config.bp_version == 4; // rct::genRctSimple
311  }
312 
313  bool is_bulletproof() const {
314  auto tp = get_rv_type();
316  }
317 
318  bool is_bulletproof_plus() const {
319  auto tp = get_rv_type();
320  return rct::is_rct_bulletproof_plus(tp);
321  }
322 
323  bool is_clsag() const {
324  auto tp = get_rv_type();
325  return rct::is_rct_clsag(tp);
326  }
327 
328  bool is_offloading() const {
329  return m_ct.rsig_param && m_ct.rsig_param->offload_type() != 0;
330  }
331 
332  size_t num_outputs() const {
333  return m_ct.tx_data.splitted_dsts.size();
334  }
335 
336  size_t num_inputs() const {
337  return m_ct.tx_data.sources.size();
338  }
339 
340  const TData & tdata() const {
341  return m_ct;
342  }
343  };
344 
345  // TX Key decryption
347 
348  std::shared_ptr<messages::monero::MoneroGetTxKeyRequest> get_tx_key(
349  const hw::device_cold::tx_key_data_t & tx_data);
350 
351  void get_tx_key_ack(
352  std::vector<::crypto::secret_key> & tx_keys,
353  const std::string & tx_prefix_hash,
354  const ::crypto::secret_key & view_key_priv,
355  std::shared_ptr<const messages::monero::MoneroGetTxKeyAck> ack
356  );
357 }
358 
359 }
360 }
361 }
362 
363 
364 #endif //MONERO_PROTOCOL_H
const tx_construction_data & cur_tx() const
Definition: protocol.hpp:228
const char * res
Definition: hmac_keccak.cpp:42
rct::RCTConfig rct_config
Definition: wallet2.h:569
void step_set_rsig_ack(std::shared_ptr< const messages::monero::MoneroTransactionSetOutputAck > ack)
Definition: protocol.cpp:821
POD_CLASS ec_point
Definition: crypto.h:55
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
const uint32_t T[512]
Definition: groestl_tables.h:36
std::string hash_addr(const MoneroAccountPublicAddress *addr, boost::optional< uint64_t > amount, boost::optional< bool > is_subaddr)
Definition: protocol.cpp:292
std::vector< std::string > tx_out_entr_hmacs
Definition: protocol.hpp:187
void process_bproof(rsig_v &bproof)
Definition: protocol.cpp:778
std::vector< std::string > spend_encs
Definition: protocol.hpp:194
size_t m_tx_idx
Definition: protocol.hpp:216
Definition: rctTypes.h:301
messages::monero::MoneroTransactionInitRequest_MoneroTransactionData TsxData
Definition: protocol.hpp:145
std::vector< std::string > couts_dec
Definition: protocol.hpp:198
Definition: device_cold.hpp:40
std::vector< std::string > signatures
Definition: protocol.hpp:199
messages::monero::MoneroTransactionDestinationEntry MoneroTransactionDestinationEntry
Definition: protocol.hpp:146
int bp_version
Definition: protocol.hpp:178
std::shared_ptr< messages::monero::MoneroTransactionSignInputRequest > step_sign_input(size_t idx)
Definition: protocol.cpp:892
messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry_MoneroRctKeyPublic MoneroRctKey
Definition: protocol.hpp:151
const tools::wallet2::transfer_details & get_source_transfer(size_t idx) const
Definition: protocol.hpp:237
Definition: cryptonote_basic.h:538
size_t num_outputs() const
Definition: protocol.hpp:332
static const unsigned char iv[64]
Definition: sha512-hash.c:13
void step_sign_input_ack(std::shared_ptr< const messages::monero::MoneroTransactionSignInputAck > ack)
Definition: protocol.cpp:916
const tx_construction_data & cur_src_tx() const
Definition: protocol.hpp:223
::std::string string
Definition: gtest-port.h:1097
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:1066
Definition: rctTypes.h:97
void string_to_key(::crypto::ec_scalar &key, const std::string &str)
Definition: protocol.cpp:98
bool should_compute_bp_now() const
Definition: protocol.cpp:744
void set_tx_input(MoneroTransactionSourceEntry *dst, size_t idx, bool need_ring_keys=false, bool need_ring_indices=false)
Definition: protocol.cpp:453
bool is_simple() const
Definition: protocol.hpp:296
std::string enc_salt1
Definition: protocol.hpp:202
messages::monero::MoneroKeyImageSyncStepAck_MoneroExportedKeyImage MoneroExportedKeyImage
Definition: protocol.hpp:111
boost::variant< rct::Bulletproof, rct::BulletproofPlus > rsig_v
Definition: protocol.hpp:167
bool cn_deserialize(const void *buff, size_t len, T &dst)
Definition: protocol.hpp:68
bool is_bulletproof() const
Definition: protocol.hpp:313
std::shared_ptr< rct::rctSig > rv
Definition: protocol.hpp:206
std::string cn_serialize(T &obj)
Definition: protocol.hpp:80
bool is_bulletproof_plus() const
Definition: protocol.hpp:318
std::shared_ptr< messages::monero::MoneroTransactionInputViniRequest > step_set_vini_input(size_t idx)
Definition: protocol.cpp:629
std::string data
Definition: base58.cpp:37
Definition: protocol.hpp:172
const char * key
Definition: hmac_keccak.cpp:40
crypto namespace.
Definition: crypto.cpp:60
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:72
std::shared_ptr< MoneroRsigData > rsig_param
Definition: protocol.hpp:180
const char * s
Definition: minissdp.c:596
Definition: binary_archive.h:180
std::string enc_keys
Definition: protocol.hpp:204
messages::monero::MoneroTransactionSourceEntry_MoneroMultisigKLRki MoneroMultisigKLRki
Definition: protocol.hpp:149
const unsigned TAG_SIZE
Definition: protocol.hpp:95
std::vector< std::string > tx_out_hmacs
Definition: protocol.hpp:188
std::string store_tx_aux_info()
Definition: protocol.cpp:993
void compute_bproof(messages::monero::MoneroTransactionRsigData &rsig_data)
Definition: protocol.cpp:749
unsigned char uint8_t
Definition: stdint.h:124
std::shared_ptr< messages::monero::MoneroTransactionInitRequest > step_init()
Definition: protocol.cpp:506
std::vector< std::string > couts
Definition: protocol.hpp:197
int bp_version
Definition: rctTypes.h:310
Definition: exceptions.hpp:79
std::string compute_hash(const MoneroTransferDetails &rr)
Definition: protocol.cpp:170
Definition: rctTypes.h:113
void assign_to_repeatable(::google::protobuf::RepeatedField< sub_t > *dst, const InputIterator begin, const InputIterator end)
Definition: protocol.hpp:53
bool is_clsag() const
Definition: protocol.hpp:323
tools::wallet2::unsigned_tx_set unsigned_tx_set
Definition: protocol.hpp:155
void step_all_inputs_set_ack(std::shared_ptr< const messages::monero::MoneroTransactionAllInputsSetAck > ack)
Definition: protocol.cpp:653
std::vector< cryptonote::tx_source_entry > sources
Definition: wallet2.h:562
void translate_rct_key(MoneroRctKey *dst, const rct::ctkey *src)
Definition: protocol.cpp:287
size_t cur_batch_idx
Definition: protocol.hpp:183
bool is_rct_bulletproof(int type)
Definition: rctTypes.cpp:206
std::vector< tx_construction_data > txes
Definition: wallet2.h:698
binary_archive< false > ba
Definition: bulletproof.cpp:40
void load_tx_key_data(hw::device_cold::tx_key_data_t &res, const std::string &data)
Definition: protocol.cpp:1022
std::string enc_salt2
Definition: protocol.hpp:203
hw::device_cold::exported_key_image exported_key_image
Definition: protocol.hpp:112
void step_init_ack(std::shared_ptr< const messages::monero::MoneroTransactionInitAck > ack)
Definition: protocol.cpp:569
Definition: wallet2.h:560
hw::tx_aux_data * m_aux_data
Definition: protocol.hpp:218
void step_all_outs_set_ack(std::shared_ptr< const messages::monero::MoneroTransactionAllOutSetAck > ack, hw::device &hwdev)
Definition: protocol.cpp:830
messages::monero::MoneroKeyImageSyncStepRequest_MoneroTransferDetails MoneroTransferDetails
Definition: protocol.hpp:109
Definition: binary_archive.h:93
std::vector< rct::ecdhTuple > tx_out_ecdh
Definition: protocol.hpp:191
messages::monero::MoneroKeyImageExportInitRequest_MoneroSubAddressIndicesList MoneroSubAddressIndicesList
Definition: protocol.hpp:110
unsigned client_version() const
Definition: protocol.hpp:285
::crypto::secret_key compute_enc_key(const ::crypto::secret_key &private_view_key, const std::string &aux, const std::string &salt)
Definition: protocol.cpp:326
POD_CLASS ec_scalar
Definition: crypto.h:59
std::shared_ptr< messages::monero::MoneroTransactionFinalRequest > step_final()
Definition: protocol.cpp:933
const TData & tdata() const
Definition: protocol.hpp:340
void translate_dst_entry(MoneroTransactionDestinationEntry *dst, const cryptonote::tx_destination_entry *src)
Definition: protocol.cpp:272
void serialize(Archive &a, unsigned_tx_set &x, const boost::serialization::version_type ver)
Definition: serialization.cpp:898
bool key_image_data(wallet_shim *wallet, const std::vector< tools::wallet2::transfer_details > &transfers, std::vector< MoneroTransferDetails > &res)
Definition: protocol.cpp:147
std::shared_ptr< messages::monero::MoneroTransactionSetOutputRequest > step_rsig(size_t idx)
Definition: protocol.cpp:806
messages::monero::MoneroTransactionSourceEntry_MoneroOutputEntry MoneroOutputEntry
Definition: protocol.hpp:150
bool m_multisig
Definition: protocol.hpp:221
Definition: rctTypes.h:79
messages::monero::MoneroTransactionDestinationEntry_MoneroAccountPublicAddress MoneroAccountPublicAddress
Definition: protocol.hpp:147
std::vector< std::string > pseudo_outs
Definition: protocol.hpp:195
std::vector< cryptonote::tx_destination_entry > splitted_dsts
Definition: wallet2.h:564
void extract_payment_id()
Definition: protocol.cpp:390
bool is_req_clsag() const
Definition: protocol.hpp:305
Definition: protocol.hpp:211
size_t cur_output_idx
Definition: protocol.hpp:182
Definition: device.cpp:38
void generate_commitment(std::vector< MoneroTransferDetails > &mtds, const std::vector< tools::wallet2::transfer_details > &transfers, std::shared_ptr< messages::monero::MoneroKeyImageExportInitRequest > &req)
Definition: protocol.cpp:191
std::shared_ptr< messages::monero::MoneroTransactionAllInputsSetRequest > step_all_inputs_set()
Definition: protocol.cpp:649
Definition: rctTypes.h:307
Definition: device.hpp:87
TsxData tsx_data
Definition: protocol.hpp:174
std::shared_ptr< messages::monero::MoneroTransactionAllOutSetRequest > step_all_outs_set()
Definition: protocol.cpp:826
Definition: wallet.py:1
bool success
Definition: cold-transaction.cpp:57
void step_set_output_ack(std::shared_ptr< const messages::monero::MoneroTransactionSetOutputAck > ack)
Definition: protocol.cpp:671
POD_CLASS public_key
Definition: crypto.h:61
tools::wallet2::tx_construction_data tx_construction_data
Definition: protocol.hpp:154
messages::monero::MoneroTransactionSourceEntry MoneroTransactionSourceEntry
Definition: protocol.hpp:148
Definition: device_cold.hpp:44
unsigned m_client_version
Definition: protocol.hpp:220
Definition: wallet2.h:696
bool is_offloading() const
Definition: protocol.hpp:328
r
Definition: testupnpigd.py:61
const char *const str
Definition: portlistingparse.c:23
void step_set_input_ack(std::shared_ptr< const messages::monero::MoneroTransactionSetInputAck > ack)
Definition: protocol.cpp:585
std::vector< size_t > source_permutation
Definition: protocol.hpp:192
void compute_integrated_indices(TsxData *tsx_data)
Definition: protocol.cpp:482
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:122
Definition: cryptonote_basic.h:511
void translate_klrki(MoneroMultisigKLRki *dst, const rct::multisig_kLRki *src)
Definition: protocol.cpp:280
protocol
Definition: console.py:53
TData()
Definition: protocol.cpp:371
messages::monero::MoneroTransactionRsigData MoneroRsigData
Definition: protocol.hpp:152
std::vector< rsig_v > tx_out_rsigs
Definition: protocol.hpp:189
POD_CLASS key_image
Definition: crypto.h:92
void translate_address(MoneroAccountPublicAddress *dst, const cryptonote::account_public_address *src)
Definition: protocol.cpp:267
std::string compute_sealing_key(const std::string &master_key, size_t idx, bool is_iv)
Definition: protocol.cpp:346
size_t num_inputs() const
Definition: protocol.hpp:336
std::vector< std::string > alphas
Definition: protocol.hpp:193
tx_construction_data tx_data
Definition: protocol.hpp:175
std::shared_ptr< messages::monero::MoneroTransactionSetInputRequest > step_set_input(size_t idx)
Definition: protocol.cpp:577
const tools::wallet2::transfer_details & get_transfer(size_t idx) const
Definition: protocol.hpp:232
std::tuple< uint64_t, uint64_t, wallet2::transfer_container > transfers
Definition: wallet2.h:699
wallet_shim * m_wallet2
Definition: protocol.hpp:214
std::shared_ptr< messages::monero::MoneroGetTxKeyRequest > get_tx_key(const hw::device_cold::tx_key_data_t &tx_data)
Definition: protocol.cpp:1053
cryptonote::transaction tx
Definition: transaction.cpp:40
RangeProofType range_proof_type
Definition: rctTypes.h:309
size_t cur_input_idx
Definition: protocol.hpp:181
Definition: device_cold.hpp:98
std::string tx_prefix_hash
Definition: protocol.hpp:201
void step_final_ack(std::shared_ptr< const messages::monero::MoneroTransactionFinalAck > ack)
Definition: protocol.cpp:937
Definition: cryptonote_tx_utils.h:74
bool is_req_bulletproof_plus() const
Definition: protocol.hpp:309
void assign_from_repeatable(std::vector< sub_t > *dst, const InputIterator begin, const InputIterator end)
Definition: protocol.hpp:61
bool is_rct_bulletproof_plus(int type)
Definition: rctTypes.cpp:219
POD_CLASS hash
Definition: hash.h:49
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 is_rct_clsag(int type)
Definition: rctTypes.cpp:242
unsigned rsig_type
Definition: protocol.hpp:177
const unsigned IV_SIZE
Definition: protocol.hpp:94
std::vector< rct::key > rsig_gamma
Definition: protocol.hpp:200
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:219
std::vector< uint64_t > grouping_vct
Definition: protocol.hpp:179
std::vector< std::string > tx_in_hmacs
Definition: protocol.hpp:186
std::string key_to_string(const ::crypto::ec_point &key)
Definition: protocol.cpp:82
void step_set_vini_input_ack(std::shared_ptr< const messages::monero::MoneroTransactionInputViniAck > ack)
Definition: protocol.cpp:645
std::vector< std::string > pseudo_outs_hmac
Definition: protocol.hpp:196
void sort_ki()
Definition: protocol.cpp:601
bool is_req_bulletproof() const
Definition: protocol.hpp:301
std::shared_ptr< messages::monero::MoneroTransactionSetOutputRequest > step_set_output(size_t idx)
Definition: protocol.cpp:656
Definition: cryptonote_basic.h:204
uint8_t get_rv_type() const
Definition: protocol.hpp:289
TData m_ct
Definition: protocol.hpp:213
cryptonote::transaction tx
Definition: protocol.hpp:176
std::vector< size_t > selected_transfers
Definition: wallet2.h:565
size_t cur_output_in_batch_idx
Definition: protocol.hpp:184
const unsigned_tx_set * m_unsigned_tx
Definition: protocol.hpp:217
Definition: wallet2.h:347
std::vector< rct::ctkey > tx_out_pk
Definition: protocol.hpp:190
std::vector< std::pair< crypto::key_image, crypto::signature > > exported_key_image
Definition: device_cold.hpp:56