Commit graph

29 commits

Author SHA1 Message Date
moneromooo-monero
b49ddc766d
check accessing an element past the end of a container 2017-12-18 15:15:49 +00:00
moneromooo-monero
09ce03d612
move includes around to lessen overall load 2017-12-16 22:46:38 +00:00
moneromooo-monero
ada4291469
add a version of ge_double_scalarmult_precomp_vartime with A precomp 2017-12-07 19:23:10 +00:00
moneromooo-monero
d43eef6def
ringct: add a version of addKeys which returns the result 2017-12-07 19:23:08 +00:00
moneromooo-monero
00cbf72064
ringct: move ge_frombytes_vartime failure error to warning
Avoids scaring people when seeing some invalid txes
2017-03-22 21:26:38 +00:00
moneromooo-monero
5833d66f65
Change logging to easylogging++
This replaces the epee and data_loggers logging systems with
a single one, and also adds filename:line and explicit severity
levels. Categories may be defined, and logging severity set
by category (or set of categories). epee style 0-4 log level
maps to a sensible severity configuration. Log files now also
rotate when reaching 100 MB.

To select which logs to output, use the MONERO_LOGS environment
variable, with a comma separated list of categories (globs are
supported), with their requested severity level after a colon.
If a log matches more than one such setting, the last one in
the configuration string applies. A few examples:

This one is (mostly) silent, only outputting fatal errors:

MONERO_LOGS=*:FATAL

This one is very verbose:

MONERO_LOGS=*:TRACE

This one is totally silent (logwise):

MONERO_LOGS=""

This one outputs all errors and warnings, except for the
"verify" category, which prints just fatal errors (the verify
category is used for logs about incoming transactions and
blocks, and it is expected that some/many will fail to verify,
hence we don't want the spam):

MONERO_LOGS=*:WARNING,verify:FATAL

Log levels are, in decreasing order of priority:
FATAL, ERROR, WARNING, INFO, DEBUG, TRACE

Subcategories may be added using prefixes and globs. This
example will output net.p2p logs at the TRACE level, but all
other net* logs only at INFO:

MONERO_LOGS=*:ERROR,net*:INFO,net.p2p:TRACE

Logs which are intended for the user (which Monero was using
a lot through epee, but really isn't a nice way to go things)
should use the "global" category. There are a few helper macros
for using this category, eg: MGINFO("this shows up by default")
or MGINFO_RED("this is red"), to try to keep a similar look
and feel for now.

Existing epee log macros still exist, and map to the new log
levels, but since they're used as a "user facing" UI element
as much as a logging system, they often don't map well to log
severities (ie, a log level 0 log may be an error, or may be
something we want the user to see, such as an important info).
In those cases, I tried to use the new macros. In other cases,
I left the existing macros in. When modifying logs, it is
probably best to switch to the new macros with explicit levels.

The --log-level options and set_log commands now also accept
category settings, in addition to the epee style log levels.
2017-01-16 00:25:46 +00:00
Shen Noether
76958fc75a
ringct: switch to Borromean signatures 2016-12-04 21:54:11 +00:00
moneromooo-monero
59f0d4b574
ringct: some more small optimizations 2016-10-23 16:10:17 +01:00
moneromooo-monero
9ebf7b6dcf
ringct: avoid unnecessary memcpy 2016-10-15 11:58:29 +01:00
moneromooo-monero
1fe75c1ea7
ringct: add a few consts where possible 2016-10-15 11:58:24 +01:00
moneromooo-monero
ab002a1d97
ringct: pass vectors by const ref where possible 2016-10-15 11:58:18 +01:00
moneromooo-monero
f24ab58d18
ringct: remove unused code 2016-08-28 21:30:53 +01:00
moneromooo-monero
fd11271eea
ringct: use memcpy/memset instead of handwritten loop where appropriate 2016-08-28 21:30:49 +01:00
moneromooo-monero
5d38206fcc
ringct: remove spurious copies 2016-08-28 21:30:47 +01:00
moneromooo-monero
d4b62a1e29
rct amount key modified as per luigi1111's recommendations
This allows the key to be not the same for two outputs sent to
the same address (eg, if you pay yourself, and also get change
back). Also remove the key amounts lists and return parameters
since we don't actually generate random ones, so we don't need
to save them as we can recalculate them when needed if we have
the correct keys.
2016-08-28 21:30:19 +01:00
moneromooo-monero
9b70856ccb
rct: make the amount key derivable by a third party with the tx key
Scheme design from luigi1114.
2016-08-28 21:29:46 +01:00
moneromooo-monero
1e21651f24
rct: use the already defined H where possible
Found by luigi1111w
2016-08-28 21:29:29 +01:00
Shen Noether
dbb5f2d6a3
ringct: optimization/cleanup of hash functions 2016-08-28 21:29:16 +01:00
Shen Noether
4fd01f2bee
ringct: "simple" ringct variant
Allows the fake outs to be in different positions for each ring.
For rct inputs only.
2016-08-28 21:29:14 +01:00
moneromooo-monero
35dce5c70c
ringct: fix size unit mismatch calling keccak 2016-08-28 21:28:57 +01:00
moneromooo-monero
73d59f17e1
ringct: catch errors from ge_frombytes_vartime 2016-08-28 21:28:45 +01:00
moneromooo-monero
dee42d6dac
ringct: add functions to commit to an amount
One to commit to an amount with zero key (for use with fake
commitments for pre-rct outputs), and one with an arbitrary
key (for rct outputs).
2016-08-28 21:28:33 +01:00
moneromooo-monero
09c5ea43a2
ringct: simplify random key generation 2016-08-28 21:28:03 +01:00
Shen Noether
56f6549962
ringct: cosmetic fixes
Ported from Shen's RingCT repo
2016-08-28 21:27:59 +01:00
Shen Noether
55ff136e12
ringct: changes to hashToPointSimple to calcualte H2 values
Ported from Shen's RingCT repo
2016-08-28 21:27:57 +01:00
Shen Noether
63733b1785
ringct: compare keys with bitwise equality, not crypto ops
Ported from Shen's RingCT repo
2016-08-28 21:27:56 +01:00
Shen Noether
98f4c6f7eb
ringct: fix size argument to cn_fast_hash
Ported from Shen's RingCT repo
2016-08-28 21:27:54 +01:00
moneromooo-monero
86b4426191
ringct: lock access to the PRNG 2016-08-28 21:27:30 +01:00
moneromooo-monero
9b1afe5f2d
ringct: import of Shen Noether's ring confidential transactions 2016-08-28 21:26:54 +01:00