Commit Graph

264 Commits

Author SHA1 Message Date
stoffu
07cb574ca4
ringct: remove duplicate rv.mixRing = mixRing; in genRctSimple 2019-01-08 11:51:35 +09:00
moneromooo-monero
aaafa8a946
ringct: avoid repeated point conversion 2018-12-12 12:48:10 +00:00
Riccardo Spagni
6bc0c7e685
Merge pull request #4927
6456cb41 Bulletproof: Initialize members in default construtor. (Tadeas Moravec)
2018-12-12 12:01:31 +02:00
Riccardo Spagni
e9aa886d9e
Merge pull request #4921
ac665418 ringct: fix dummy bulletproofs on ledger in fake mode (moneromooo-monero)
2018-12-12 11:59:56 +02:00
Riccardo Spagni
81418cb281
Merge pull request #4894
aee7a4e3 wallet_rpc_server: do not use RPC data if the call failed (moneromooo-monero)
1a0733e5 windows_service: fix memory leak (moneromooo-monero)
0dac3c64 unit_tests: do not rethrow a copy of an exception (moneromooo-monero)
5d9915ab cryptonote: fix get_unit for non default settings (moneromooo-monero)
d4f50cb1 remove some unused code (moneromooo-monero)
61163971 a few minor (but easy) performance tweaks (moneromooo-monero)
30023074 tests: slow_memmem now returns size_t (moneromooo-monero)
2018-12-04 17:33:19 +02:00
Riccardo Spagni
6d1c2a9304
Merge pull request #4892
c28e3d2d rctOps: add braces to suppress warnings (stoffu)
2018-12-04 17:32:42 +02:00
Riccardo Spagni
c00ac446fd
Merge pull request #4854
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
2018-12-04 17:08:42 +02:00
Tadeas Moravec
6456cb415a
Bulletproof: Initialize members in default construtor.
Fixing a build warning on g++ 7.3.0
2018-12-01 13:03:32 +00:00
moneromooo-monero
ac665418f0
ringct: fix dummy bulletproofs on ledger in fake mode
Ledger does some basic checks on them
2018-11-30 13:33:29 +00:00
Riccardo Spagni
3e2abc9eaa
Merge pull request #4834
2c7195d8 bulletproofs: avoid std::vector allocations for slice (moneromooo-monero)
2018-11-26 20:30:15 +02:00
moneromooo-monero
611639710d
a few minor (but easy) performance tweaks
Found by codacy.com
2018-11-23 15:36:48 +00:00
stoffu
c28e3d2dae
rctOps: add braces to suppress warnings 2018-11-23 12:28:04 +09:00
Riccardo Spagni
0295055bcb
Merge pull request #4805
6a1062f5 bulletproofs: reserve vector memory when known in advance (moneromooo-monero)
2018-11-16 11:16:12 +02:00
Riccardo Spagni
cec336ecbc
Merge pull request #4804
00907c39 rct: speedup commit a little (moneromooo-monero)
2018-11-16 11:15:56 +02:00
Riccardo Spagni
46f989bc49
Merge pull request #4795
5d7c2316 rct: add a zeroCommit cache for common pre-rct case (moneromooo-monero)
2018-11-16 11:11:10 +02:00
Martijn Otto
bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01:00
moneromooo-monero
2c7195d80c
bulletproofs: avoid std::vector allocations for slice 2018-11-09 19:58:11 +00:00
moneromooo-monero
6a1062f560
bulletproofs: reserve vector memory when known in advance 2018-11-05 14:32:32 +00:00
moneromooo-monero
00907c3987
rct: speedup commit a little
saves a conversion, and uses a double scalarmult instead of
two scalarmults
2018-11-05 14:25:11 +00:00
Riccardo Spagni
6d3d8635be
Merge pull request #4693
74fb3d88 multiexp: some minor speedups (moneromooo-monero)
a6d2e246 bulletproofs: only enable profiling on request (moneromooo-monero)
a110e6aa multiexp: tune which variants to use for which number of points (moneromooo-monero)
8b476722 bulletproofs: speedup prover (moneromooo-monero)
6f9ae5b6 multiexp: handle pippenger multiexps with part precalc (moneromooo-monero)
10e5a927 bulletproofs: maintain -z4, -z5, and -y0 to avoid subtractions (moneromooo-monero)
8629a42c bulletproofs: rework flow to use sarang's fast batch inversion code (moneromooo-monero)
fc9f7d9c bulletproofs: merge multiexps as per sarang's new python code (moneromooo-monero)
4061960a multiexp: pack the digits table when STRAUS_C is 4 (moneromooo-monero)
bf8e4b98 bulletproofs: some more minor speedup (moneromooo-monero)
c415df97 performance_tests: sc_check and ge_dsm_precomp (moneromooo-monero)
a281b950 bulletproofs: remove single value prover (moneromooo-monero)
484155d0 bulletproofs: some more speedup (moneromooo-monero)
a621d6c8 bulletproofs: random minor speedups (moneromooo-monero)
a49a1761 bulletproofs: shave off a lot of scalar muls from the g/h construction (moneromooo-monero)
4564a5d1 bulletproofs: speedup PROVE (moneromooo-monero)
2018-11-04 20:46:42 +02:00
moneromooo-monero
5d7c231604
rct: add a zeroCommit cache for common pre-rct case
This is called for every pre-rct output at blockchain sync time,
and a lot of them wil hit the cache, saving a scalarmult each.
2018-11-04 15:44:56 +00:00
Dusan Klinec
29ffb6bba8
device/trezor: trezor support added 2018-11-02 21:36:39 +01:00
moneromooo-monero
d6937e373b
ringct: use dummy bulletproofs when in fake mode, for speed 2018-10-23 21:03:18 +00:00
moneromooo-monero
74fb3d882c
multiexp: some minor speedups 2018-10-22 16:08:26 +00:00
moneromooo-monero
a6d2e246f3
bulletproofs: only enable profiling on request 2018-10-22 16:07:44 +00:00
moneromooo-monero
a110e6aa18
multiexp: tune which variants to use for which number of points 2018-10-22 16:07:44 +00:00
moneromooo-monero
8b4767221c
bulletproofs: speedup prover 2018-10-22 16:07:44 +00:00
moneromooo-monero
6f9ae5b6eb
multiexp: handle pippenger multiexps with part precalc 2018-10-22 16:07:44 +00:00
moneromooo-monero
10e5a92769
bulletproofs: maintain -z4, -z5, and -y0 to avoid subtractions 2018-10-22 16:07:44 +00:00
moneromooo-monero
8629a42cf6
bulletproofs: rework flow to use sarang's fast batch inversion code 2018-10-22 16:07:44 +00:00
moneromooo-monero
fc9f7d9c81
bulletproofs: merge multiexps as per sarang's new python code 2018-10-22 16:07:44 +00:00
moneromooo-monero
4061960a16
multiexp: pack the digits table when STRAUS_C is 4
Spotted by stoffu
2018-10-22 16:07:44 +00:00
moneromooo-monero
bf8e4b9870
bulletproofs: some more minor speedup 2018-10-22 16:07:44 +00:00
moneromooo-monero
a281b950bf
bulletproofs: remove single value prover
It is now expressed in terms of the array prover
2018-10-22 16:07:44 +00:00
moneromooo-monero
484155d043
bulletproofs: some more speedup 2018-10-22 16:07:44 +00:00
moneromooo-monero
a621d6c8b4
bulletproofs: random minor speedups 2018-10-22 16:07:44 +00:00
moneromooo-monero
a49a17618f
bulletproofs: shave off a lot of scalar muls from the g/h construction 2018-10-22 16:07:44 +00:00
moneromooo-monero
4564a5d17b
bulletproofs: speedup PROVE 2018-10-22 16:07:44 +00:00
moneromooo-monero
1dd5c73f62
bulletproofs: multiply points by 8 first thing in verification
instead of merging that with other scalar multiplications
where possible for speed, since this is not actually safe
2018-09-24 14:02:51 +00:00
Riccardo Spagni
4a652d6b52
Merge pull request #4379
607301bf rct: avoid repeated unnecessary conversions when accummulating (moneromooo-monero)
2018-09-21 20:42:41 +02:00
moneromooo-monero
607301bf6d
rct: avoid repeated unnecessary conversions when accummulating 2018-09-14 10:18:01 +00:00
stoffu
67a56a9f8b
rctTypes: fix incorrect serialization 2018-09-12 20:33:10 +09:00
moneromooo-monero
8f418a6db0
bulletproofs: #include <openssl/bn.h>
Apparently needed for openssl 1.1.x
2018-09-11 13:38:34 +00:00
moneromooo-monero
2bf636503f
bulletproofs: speed up the latest changes a bit 2018-09-11 13:38:32 +00:00
moneromooo-monero
044dff5a30
bulletproofs: scale points by 8 to ensure subgroup validity 2018-09-11 13:38:31 +00:00
moneromooo-monero
c83012c476
bulletproofs: match aggregated verification to sarang's latest prototype 2018-09-11 13:38:30 +00:00
moneromooo-monero
463434d1f7
more comprehensive test for ge_p3 comparison to identity/point at infinity
Reported by QuarksLab.
2018-09-11 13:38:20 +00:00
moneromooo-monero
a129bbd944
multiexp: fix maxscalar off by one
Reported by QuarksLab.
2018-09-11 13:38:17 +00:00
moneromooo-monero
7ed496cc78
ringct: error out when hashToPoint* returns the point at infinity
Reported by QuarksLab.
2018-09-11 13:38:16 +00:00
moneromooo-monero
61632dc166
ringct: prevent a potential very large allocation
Reported by QuarksLab.
2018-09-11 13:38:14 +00:00
moneromooo-monero
0825e97436
multiexp: fix wrong Bos-Coster result for 1 non trivial input
Reported by QuarksLab.
2018-09-11 13:38:10 +00:00
moneromooo-monero
a1359ad43c
Check inputs to addKeys are in range
Reported by QuarksLab.
2018-09-11 13:38:09 +00:00
moneromooo-monero
fe0fa3b9c5
bulletproofs: reject x, y, z, or w[i] being zero
Also try again when we're generate a proof with those characteristics

Reported by QuarksLab.
2018-09-11 13:38:08 +00:00
moneromooo-monero
5ffb2ff9b7
v8: per byte fee, pad bulletproofs, fixed 11 ring size 2018-09-11 13:38:07 +00:00
moneromooo-monero
869b3bf824
bulletproofs: a few fixes from the Kudelski review
- fix integer overflow in n_bulletproof_amounts
- check input scalars are in range
- remove use of environment variable to tweak straus performance
- do not use implementation defined signed shift for signum
2018-09-11 13:38:05 +00:00
moneromooo-monero
c429176248
bulletproofs: reject points not in the main subgroup 2018-09-11 13:38:04 +00:00
moneromooo-monero
1569717718
bulletproofs: speed up a few multiplies using existing Hi cache 2018-09-11 13:38:03 +00:00
moneromooo-monero
0b05a0fa74
Add Pippenger cache and limit Straus cache size 2018-09-11 13:38:02 +00:00
moneromooo-monero
263431c486
Pippenger multiexp
Based on sarang's python code
2018-09-11 13:37:45 +00:00
moneromooo-monero
1ed0ed4de4
multiexp: cut down on memory allocations 2018-09-11 13:37:44 +00:00
moneromooo-monero
1b867e7f40
precalc the ge_p3 representation of H 2018-09-11 13:37:42 +00:00
moneromooo-monero
7e67c52fa2
Add a define for the max number of bulletproof multi-outputs 2018-09-11 13:37:38 +00:00
moneromooo-monero
2a8fcb421b
Bulletproof aggregated verification and tests
Also constrains bulletproofs to simple rct, for simplicity
2018-09-11 13:37:37 +00:00
moneromooo-monero
126196b017
multiexp: some speedups
- use a raw memory block to store cache
- use aligned memory
- use doubling API where appropriate
- calculate straus in bands
2018-09-11 13:37:35 +00:00
moneromooo-monero
bacf0a1e2f
bulletproofs: add aggregated verification
Ported from sarang's java code
2018-09-11 13:37:32 +00:00
moneromooo-monero
e895c3def1
make straus cached mode thread safe, and add tests for it 2018-09-11 13:37:31 +00:00
moneromooo-monero
7f48bf05d7
multiexp: bos coster now works for just one point 2018-09-11 13:37:30 +00:00
moneromooo-monero
9ce9f8caf6
bulletproofs: add multi output bulletproofs to rct 2018-09-11 13:37:28 +00:00
moneromooo-monero
939bc22332
add Straus multiexp 2018-09-11 13:37:25 +00:00
moneromooo-monero
9ff6e6a0a7
ringct: add bos coster multiexp 2018-09-11 13:37:24 +00:00
moneromooo-monero
e9164bb38b
bulletproofs: misc optimizations
Use double mults where possible, avoid conversions, simplify
2018-09-11 13:37:23 +00:00
moneromooo-monero
aacfd6e370
bulletproofs: multi-output bulletproofs 2018-09-11 13:37:17 +00:00
moneromooo-monero
7c8f95d3e2
ringct: make conversion functions return const refs
This might avoid unnecessary copies.

Reported by stoffu
2018-09-04 18:28:20 +00:00
luigi1111
5f1bbe3bce
Merge pull request #4268
1f2409e Do memwipe for critical secret keys copied to rct::key (stoffu)
2018-09-04 13:16:04 -05:00
moneromooo-monero
d2e26c23f3
add and use constant time 32 byte equality function 2018-08-23 07:56:51 +00:00
luigi1111
a5d21be843
Merge pull request #4210
4616cf2 Fixed ZMQ-RPC for transactions and GET_BLOCKS_FAST (vtnerd)
2018-08-22 20:47:28 -05:00
stoffu
1f2409e9e2
Do memwipe for critical secret keys copied to rct::key 2018-08-16 22:26:30 +09:00
Lee Clagett
4616cf2641 Fixed ZMQ-RPC for transactions and GET_BLOCKS_FAST 2018-08-02 07:30:20 +00:00
luigi1111
3fde902394
Merge pull request #4097
61caab8 crypto: remove slight bias in key generation due to modulo (moneromooo-monero)
2018-07-27 14:23:54 -05:00
luigi1111
94ed562148
Merge pull request #4045
7cdd147 Changed URLs to HTTPS (einsteinsfool)
2018-07-19 13:56:38 -05:00
moneromooo-monero
61caab8a8c
crypto: remove slight bias in key generation due to modulo 2018-07-05 09:18:01 +01:00
moneromooo-monero
2771a18e85
threadpool: allow leaf functions to run concurrently
Decrease the number of worker threads by one to account
for the fact the calling thread acts as a worker thread now
2018-06-26 22:15:22 +01:00
einsteinsfool
7cdd147da5 Changed URLs to HTTPS 2018-06-23 21:15:29 +02:00
moneromooo-monero
01cc978722
ringct: remove an unnecessary scalarmultBase in zeroCommit 2018-06-06 10:14:36 +01:00
moneromooo-monero
5f19384729
ringct: do not show verification errors with default settings 2018-05-04 08:27:55 +01:00
Riccardo Spagni
cb72b85bbf
Merge pull request #3372
c3e23b2d ringct: 17% improvement in Borromean signature verification (moneromooo-monero)
2018-03-14 16:06:16 +02:00
stoffu
27a196b126
device: untangle cyclic depenency
When #3303 was merged, a cyclic dependency chain was generated:

    libdevice <- libcncrypto <- libringct <- libdevice

This was because libdevice needs access to a set of basic crypto operations
implemented in libringct such as scalarmultBase(), while libringct also needs
access to abstracted crypto operations implemented in libdevice such as
ecdhEncode(). To untangle this cyclic dependency chain, this patch splits libringct
into libringct_basic and libringct, where the basic crypto ops previously in
libringct are moved into libringct_basic. The cyclic dependency is now resolved
thanks to this separation:

    libcncrypto <- libringct_basic <- libdevice <- libcryptonote_basic <- libringct

This eliminates the need for crypto_device.cpp and rctOps_device.cpp.

Also, many abstracted interfaces of hw::device such as encrypt_payment_id() and
get_subaddress_secret_key() were previously implemented in libcryptonote_basic
(cryptonote_format_utils.cpp) and were then called from hw::core::device_default,
which is odd because libdevice is supposed to be independent of libcryptonote_basic.
Therefore, those functions were moved to device_default.cpp.
2018-03-14 21:00:15 +09:00
moneromooo-monero
c3e23b2dce
ringct: 17% improvement in Borromean signature verification 2018-03-08 00:41:54 +00:00
Riccardo Spagni
98acbe83fc
Merge pull request #3348
c95dddd2 remove unused function keyImageV (h908714124)
2018-03-05 19:13:52 +02:00
Riccardo Spagni
5950d356b6
Merge pull request #3301
34a2a085 rctSigs - loop invariant code removed from the loop (Dusan Klinec)
2018-03-05 19:11:35 +02:00
h908714124
c95dddd2d2 remove unused function keyImageV 2018-03-05 09:21:44 +01:00
cslashm
e745c1e38d Code modifications to integrate Ledger HW device into monero-wallet-cli.
The basic approach it to delegate all sensitive data (master key, secret
ephemeral key, key derivation, ....) and related operations to the device.
As device has low memory, it does not keep itself the values
(except for view/spend keys) but once computed there are encrypted (with AES
are equivalent) and return back to monero-wallet-cli. When they need to be
manipulated by the device, they are decrypted on receive.

Moreover, using the client for storing the value in encrypted form limits
the modification in the client code. Those values are transfered from one
C-structure to another one as previously.

The code modification has been done with the wishes to be open to any
other hardware wallet. To achieve that a C++ class hw::Device has been
introduced. Two initial implementations are provided: the "default", which
remaps all calls to initial Monero code, and  the "Ledger", which delegates
all calls to Ledger device.
2018-03-04 12:54:53 +01:00
Dusan Klinec
34a2a08530 rctSigs - loop invariant code removed from the loop 2018-02-21 16:35:06 +01:00
Riccardo Spagni
f4a6bc79d9
Merge pull request #3226
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero)
2e3e90ac pass large parameters by const ref, not value (moneromooo-monero)
61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero)
9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero)
8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero)
9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero)
24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero)
f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero)
c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero)
fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero)
03887f11 keccak: fix sanity check bounds test (moneromooo-monero)
ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero)
bece67f9 miner: restore std::cout precision after modification (moneromooo-monero)
1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
2018-02-16 14:26:58 +01:00
Riccardo Spagni
589a53f479
Merge pull request #2959
3f1a3fac bulletproofs: more robust challenge computation (moneromooo-monero)
2018-02-14 12:08:52 +01:00
moneromooo-monero
9af6b2d1b8
ringct: fix infinite loop in unused h2b function
Coverity 146775
2018-02-02 16:44:28 +00:00
moneromooo-monero
3f1a3fac00
bulletproofs: more robust challenge computation
Changes from sarang, from a recommendation by an anonymous reviewer
2018-01-31 15:57:01 +00:00
moneromooo-monero
b809058993
ringct: pseudoOuts moved to prunable in the simple bulletproof case
Saves 64 bytes non prunable data per typical tx

This breaks v7 consensus, will require a testnet reorg from v6
2018-01-31 15:56:26 +00:00
xmr-eric
84a7f6a482 Readd copyright starting date 2018-01-26 10:03:20 -05:00
xmr-eric
18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00