-
Notifications
You must be signed in to change notification settings - Fork 36
/
changes when upgrading monero src.txt
297 lines (192 loc) · 8.7 KB
/
changes when upgrading monero src.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
1. vendor libsodium crypto_verify to contrib/libsodium
2. this should be compatible with "#include <sodium/crypto_verify_32.h>"
=================
diff -r src/common/base58.cpp /Users/paulshapiro/Documents/Repos/monero-core-custom/common/base58.cpp
38,39c38,39
< #include "int-util.h"
< #include "util.h"
---
> #include "common/int-util.h"
> //#include "util.h"
// ^----- this doesn't need to be done anymore
===================
util.h and util.cpp are heavily modified to include (almost only)
#include <boost/thread/thread.hpp>
and support only
void set_max_concurrency(unsigned n)
{
if (n < 1)
n = boost::thread::hardware_concurrency();
unsigned hwc = boost::thread::hardware_concurrency();
if (n > hwc)
n = hwc;
boost::lock_guard<boost::mutex> lock(max_concurrency_lock);
max_concurrency = n;
}
unsigned get_max_concurrency()
{
boost::lock_guard<boost::mutex> lock(max_concurrency_lock);
return max_concurrency;
}
====================
account.cpp:
< crypto::secret_key account_base::generate(const crypto::secret_key& recovery_key, bool recover, bool two_random)
---
> crypto::secret_key account_base::generate(const crypto::secret_key& recovery_key, bool recover, bool two_random, bool from_legacy16B_lw_seed)
153c87
< keccak((uint8_t *)&m_keys.m_spend_secret_key, sizeof(crypto::secret_key), (uint8_t *)&second, sizeof(crypto::secret_key));
---
> keccak((uint8_t *)&(from_legacy16B_lw_seed ? first : m_keys.m_spend_secret_key), sizeof(crypto::secret_key), (uint8_t *)&second, sizeof(crypto::secret_key));
====================
< crypto::secret_key generate(const crypto::secret_key& recovery_key = crypto::secret_key(), bool recover = false, bool two_random = false);
< void create_from_device(const std::string &device_name);
< void create_from_device(hw::device &hwdev);
---
> crypto::secret_key generate(const crypto::secret_key& recovery_key = crypto::secret_key(), bool recover = false, bool two_random = false, bool from_legacy16B_lw_seed = false);
> void create_from_device(const std::string &device_name) ;
102,106d89
====================
diff -r src/cryptonote_basic/cryptonote_basic_impl.cpp /Users/paulshapiro/Documents/Repos/monero-core-custom/cryptonote_basic/cryptonote_basic_impl.cpp
44c44
< #include "common/dns_utils.h"
---
> // #include "common/dns_utils.h"
================
cryptonote_basic_impl
< bool get_account_address_from_str_or_url(
< address_parse_info& info
< , network_type nettype
< , const std::string& str_or_url
< , std::function<std::string(const std::string&, const std::vector<std::string>&, bool)> dns_confirm
< )
< {
< if (get_account_address_from_str(info, nettype, str_or_url))
< return true;
< bool dnssec_valid;
< std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(str_or_url, dnssec_valid, dns_confirm);
< return !address_str.empty() &&
< get_account_address_from_str(info, nettype, address_str);
< }
---
> // //--------------------------------------------------------------------------------
> // bool get_account_address_from_str_or_url(
> // address_parse_info& info
> // , network_type nettype
> // , const std::string& str_or_url
> // , std::function<std::string(const std::string&, const std::vector<std::string>&, bool)> dns_confirm
> // )
> // {
> // if (get_account_address_from_str(info, nettype, str_or_url))
> // return true;
> // bool dnssec_valid;
> // std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(str_or_url, dnssec_valid, dns_confirm);
> // return !address_str.empty() &&
> // get_account_address_from_str(info, nettype, address_str);
> // }
=======================
diff -r src/cryptonote_core/cryptonote_tx_utils.cpp /Users/paulshapiro/Documents/Repos/monero-core-custom/cryptonote_core/cryptonote_tx_utils.cpp
40c40
< #include "cryptonote_basic/miner.h"
---
> //#include "cryptonote_basic/miner.h"
...... and comment functions like construct_miner_tx
< bool construct_miner_tx(size_t height, size_t median_weight, uint64_t already_generated_coins, size_t current_block_weight
, uint64_t fee, const account_public_address &miner_address, transaction& tx, const blobdata& extra_nonce, size_t max_outs, ui
nt8_t hard_fork_version) {
> // bool construct_miner_tx(size_t height, size_t median_size, uint64_t already_generated_coins, size_t current_block_size, uint64_t fee, const account_public_address &miner_address, transaction& tx, const blobdata& extra_nonce, size_t max_outs, uint8_t hard_fork_version) {
--- and ---
> // bool generate_genesis_block(
> // block& bl
> // , std::string const & genesis_tx
> // , uint32_t nonce
> // )
> // {
=============
diff -r src/cryptonote_core/cryptonote_tx_utils.h /Users/paulshapiro/Documents/Repos/monero-core-custom/cryptonote_core/cryptonote_tx_utils.h
> // bool construct_miner_tx(size_t height, size_t median_weight, uint64_t already_generated_coins, size_t current_block_weight, uint64_t fee, const account_public_address &miner_address, transaction& tx, const blobdata& extra_nonce = blobdata(), size_t max_outs = 999, uint8_t hard_fork_version = 1);
-and-
> // bool generate_genesis_block(
> // block& bl
> // , std::string const & genesis_tx
> // , uint32_t nonce
> // );
============
diff -r src/ringct/bulletproofs.cc /Users/paulshapiro/Documents/Repos/monero-core-custom/ringct/bulletproofs.cc
32,33d31
< #include <openssl/ssl.h>
< #include <openssl/bn.h>
36,37c34
< #include "common/perf_timer.h"
< #include "cryptonote_config.h"
---
> // #include "common/perf_timer.h"
* comment calls to PERF_TIMER_UNIT / PERF_TIMER_START_BP / PERF_TIMER_STOP
* replace invert with:
/* Compute the inverse of a scalar, the naive way */
static rct::key invert(const rct::key &x)
{
static const rct::key l_minus_2 = { {0xeb, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 } };
rct::key inv = rct::identity();
rct::key tmp = x;
for (int n = 0; n < 256; ++n)
{
if (l_minus_2[n>>3] & (1<<(n&7)))
sc_mul(inv.bytes, inv.bytes, tmp.bytes);
sc_mul(tmp.bytes, tmp.bytes, tmp.bytes);
}
return inv;
}
* probably can remove bulletproof_VERIFY
==============
diff -r src/ringct/rctSigs.cpp /Users/paulshapiro/Documents/Repos/monero-core-custom/ringct/rctSigs.cpp
32c32
< #include "common/perf_timer.h"
---
> // #include "common/perf_timer.h"
and comment PERF_TIMER(verRange); etc
==============
edit multiexp.cc to comment out perf timer include and MULTIEXP_PERF( …
============
epee/include/misc_log_ex.h, and logger.h/cpp are heavily customized - don't overwrite -- update them from code shared with back-end
* add `#include <sstream>` to misc_log_ex.h
============
epee/include and epee/src mlocker.cpp:
* this might not be necessary
comment #define HAVE_MLOCK 1
and replace get_page_size with
return 4096; // just to remove some calls
// CRITICAL_REGION_LOCAL(mutex());
// if (page_size == 0)
// page_size = query_page_size();
// return page_size;
===========
important for 13-word support:
mnemonics/electrum-words.cpp
- return result.checksum() % crypto::ElectrumWords::seed_length;
+ return result.checksum() % word_list.size();
=========
for emscripten: (Note this might not actually make a difference - remove if confirmed not to)
crypto/slow-hash.c
-extern int aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey);
-extern int aesb_pseudo_round(const uint8_t *in, uint8_t *out, const uint8_t *expandedKey);
+extern void aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey);
+extern void aesb_pseudo_round(const uint8_t *in, uint8_t *out, const uint8_t *expandedKey);
-extern int aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey);
-extern int aesb_pseudo_round(const uint8_t *in, uint8_t *out, const uint8_t *expandedKey);
+extern void aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey);
+extern void aesb_pseudo_round(const uint8_t *in, uint8_t *out, const uint8_t *expandedKey);
=========
Note: this may not be necessary but might simplify emscripten compilation (remove this entry if confirmed not to)
epee/src/mlocker.cpp
-#define HAVE_MLOCK 1
+// #define HAVE_MLOCK 1
- CRITICAL_REGION_LOCAL(mutex());
- if (page_size == 0)
- page_size = query_page_size();
- return page_size;
+ return 4096;
+ // CRITICAL_REGION_LOCAL(mutex());
+ // if (page_size == 0)
+ // page_size = query_page_size();
+ // return page_size;
and comment out body of other function implementations