Commit graph

12510 commits

Author SHA1 Message Date
Jason Rhinelander
d697903bf0 Fix tests
- CLSAG handling was being missed in some test suite code
- quorumnet initialization wasn't being done
2020-09-16 20:45:09 -03:00
Jason Rhinelander
4e7a2e315f Use rct::is_rct_<whatever> where appropriate
Also inline them into the header and simplify them.

Someone added functions for is_rct_whatever but used them almost
nowhere.  This uses them (which would have saved a bunch of changes and
bugs in adding CLSAG in the first place).
2020-09-16 20:45:09 -03:00
Jason Rhinelander
f34568cb8d Fix RCTConfig in construct_tx() 2020-09-16 20:43:52 -03:00
Jason Rhinelander
7d909c74f4 Fix no-MLSAG test by adding the required 10 blocks 2020-09-16 20:43:52 -03:00
Jason Rhinelander
30c1e361a4 Rename and comment 1- vs 2-output tests
Also change the macro HF version used to be appropriate.
2020-09-16 20:43:52 -03:00
Jason Rhinelander
df7b3bed75 Don't restrict hf version for 1-tx outputs
Some tests need these (to test that the limit is actually failing
properly).
2020-09-16 20:43:52 -03:00
Jason Rhinelander
5f753e5be6 Minor wording improvement on one-tx error 2020-09-16 20:43:52 -03:00
Jason Rhinelander
b9449ff3dc Test fix: use HF version and unneeded templated HF version 2020-09-16 20:43:52 -03:00
Jason Rhinelander
c6a0f331ac Reformat BLOCK SUCCESSFULLY ADDED
Add major/minor version, and reformat it to indent it (so that it's more
obvious that it is continuing the previous line info).
2020-09-16 20:43:52 -03:00
Jason Rhinelander
82514b9956 Construct LNS txes with no destination (the way the wallet does) 2020-09-16 20:43:52 -03:00
Dusan Klinec
8c12ed13b0 enable CLSAG support for Trezor client 2020-09-16 20:43:52 -03:00
Jason Rhinelander
90bbc22c4f Fix wrong tx version in trezor code 2020-09-16 20:43:52 -03:00
Jason Rhinelander
4dc630f5f0 Fix assert message typo 2020-09-16 20:43:12 -03:00
François Colas
059ad205a9 Fix send scalar z in plaintext
The scalar z has not been generated on the HW thus it can't be sent
encrypted. The value is derived from the exported private view key.
2020-09-16 20:43:12 -03:00
François Colas
67eaed671f Update minimal Ledger Monero app version 2020-09-16 20:43:12 -03:00
cslashm
5f920bb5b0 draft support of clsag 2020-09-16 20:43:12 -03:00
Sarang Noether
534346656a CLSAG device support 2020-09-16 20:43:12 -03:00
Sarang Noether
a23539c984 Added balance check to MLSAG/CLSAG performance tests 2020-09-16 20:43:12 -03:00
Sarang Noether
05900f14d8 Updated MLSAG and CLSAG tests for consistency 2020-09-16 20:43:12 -03:00
Sarang Noether
78401c1606 CLSAG verification performance test 2020-09-16 20:43:12 -03:00
Sarang Noether
d14d5544a0 CLSAG optimizations 2020-09-16 20:43:12 -03:00
moneromooo-monero
e4b2c3089b Integrate CLSAGs into loki
They are allowed from v16, and MLSAGs are rejected from v16 + 10 blocks.
2020-09-16 20:43:12 -03:00
Jason Rhinelander
d26b508e3c Add tools::equals_any for checking an item in a list
e.g.

tools::equals_any(foo, 1, 2, 3)

is equivalent to

foo == 1 || foo == 2 || foo == 3

(and false if there are no arguments at all).
2020-09-16 20:41:39 -03:00
moneromooo-monero
5064a4fcdd unit_tests: add ge_triple_scalarmult_base_vartime test 2020-09-16 20:41:39 -03:00
Sarang Noether
c9cd4e7a81 CLSAG signatures 2020-09-16 20:41:39 -03:00
Jason Rhinelander
5878c3f7d6
Remove WARNINGS_AS_ERRORS from top-level Makefile (#1257)
-Werror is really a developer option to try to make code warning-clean,
but it shouldn't be forced on in the top-level Makefile that users are
directed to.
2020-09-16 16:26:29 +10:00
Jason Rhinelander
115ca8848b
Don't overwrite mainnet lns.db for test suite/fakechain (#1249)
Currently running the test suite obliterates a mainnet lns.db; this
fixes it to put the fakechain one under fake/ instead.
2020-09-10 10:02:40 +10:00
Jason Rhinelander
fdead96637 Backport Fix bl.* commands from pulse to dev
bl.* weren't being registered for non-service nodes.  This fixes it by
moving endpoint setup from quorumnet_new (SN-only) to a new
quorumnet_init that does endpoint setup (for both SNs and non-SNs).

(This is a backport of the changes applied on the pulse branch to get
these fixes into `dev` for testing).
2020-09-09 11:41:00 -03:00
Doyle
437fc41962
Merge pull request #1232 from Doy-lee/CNDeserializeAddWalletDeserialize
cn_deserialize: Add wallet decoding
2020-09-04 12:19:33 +10:00
Doyle
cdd1bbe616 debug_utils: Add using std::literals
- Remove using namespace literals where it explicitly includes
cryptonote_config. There's still duplicates but implicitly.
2020-09-04 10:35:59 +10:00
Doyle
3f0f7f2d36 cn_deserialize: Add wallet decoding 2020-09-04 10:35:59 +10:00
Doyle
251e51fe79
Merge pull request #1248 from jagerman/compilation-fixes
Compilation fixes
2020-09-04 10:19:51 +10:00
Jason Rhinelander
273132c98a Disable building loki-sn-keys on sodium < 1.0.17
Before 1.0.17 the primitives we need aren't exposed.
2020-09-03 15:18:36 -03:00
Jason Rhinelander
2db43a1789 Do basepoint mod via sc_reduce32 instead of libsodium
crypto_core_ed25519_scalar_add requires libsodium >= 1.0.17 (and bionic
only has 1.0.16).
2020-09-03 11:15:20 -03:00
Jason Rhinelander
1a31a6431b Win compilation fix 2020-09-03 11:06:24 -03:00
Jason Rhinelander
2d1f5167bb Silence clang warning 2020-09-03 11:06:24 -03:00
Jason Rhinelander
41b1b46cfe Add missing optional header 2020-09-03 11:06:24 -03:00
Doyle
d2412076c8
Merge pull request #1246 from jagerman/monero-pubkey-appeasement
Make Monero happier with the libsodium-provided privkey
2020-09-03 10:41:50 +10:00
Jason Rhinelander
e1322b6b07 Add equal pubkey assertion 2020-09-02 21:38:03 -03:00
Jason Rhinelander
4d3f03f8a9 Make Monero happier with the libsodium-provided privkey
Passing the libsodium-derived private key into Monero was fine *except*
when you try to generate a pubkey from it via secret_key_to_public_key:
Monero for some reason has an extra check during pubkey generation that
requires the privkey is less than the basepoint.  (This check is
pointless because a value above the basepoint is perfectly acceptable:
all operations are always mod basepoint).

This is easy to work around by explicitly doing a mod L on the private
key value before setting it in the Monero privkey.  (This results in
exactly the same pubkey, and an exactly equivalent privkey).
2020-09-02 11:39:25 -03:00
Jason Rhinelander
6a99c68ee9
Restore public RPC access to some commands (#1245)
I went through the list and found a few RPC endpoints that were
erroneously no longer public RPC accessible; this fixes them.
2020-09-02 14:51:00 +10:00
Jason Rhinelander
6a9776c4f2
RPC doc updates for last reward/state SN variables (#1244) 2020-09-02 14:50:26 +10:00
Doyle
b0f8ffa859
Merge pull request #1240 from jagerman/ed25519-keys
Use only ed25519 key by default
2020-09-01 16:26:14 +10:00
Jason Rhinelander
0bfafd15b6
Add loki-sn-keys SN key management tool (#1241)
This allows inspecting, generating, and restoring both Ed25519 and
legacy (naming in line with PR #1240 now avoiding the non-Ed25519 keys
by default) secret key files as needed by lokid:

    $ ./loki-sn-keys generate key_ed25519
    Generated SN Ed25519 secret key in key_ed25519
    Public key:      8f94f6bbc1d5876484309fc7fd41396c6bd66c4631a34f04895887547cb374dd
    X25519 pubkey:   f3e42d1aff8db8232433ec86e3f56cdda44d4c510144f9b6786520175b08c97f
    Lokinet address: t6kxpq6b4sdsjbbou9d94oj3pti7c5ngggtw6brjmndie9fuquqo.snode

    $ ./loki-sn-keys legacy key
    Generated SN legacy private key in key
    Public key: f3a513ddfbe946c79c62c27cca2260b80606a2da1b4f75ba16c793a5750a8510

    $ ./loki-sn-keys show key
    key (legacy SN keypair)
    ==========
    Private key: c8c17cc296c3e8bb603098b5d2535ad86662cdb24cd4c785c0485d0a490a2356
    Public key:  f3a513ddfbe946c79c62c27cca2260b80606a2da1b4f75ba16c793a5750a8510

    $ ./loki-sn-keys show key_ed25519
    key_ed25519 (Ed25519 SN keypair)
    ==========
    Secret key:      3f078900bac5f3e97d5fe451a6e332826d29aae2e13fec895c1b527af88093c3
    Public key:      8f94f6bbc1d5876484309fc7fd41396c6bd66c4631a34f04895887547cb374dd
    X25519 pubkey:   f3e42d1aff8db8232433ec86e3f56cdda44d4c510144f9b6786520175b08c97f
    Lokinet address: t6kxpq6b4sdsjbbou9d94oj3pti7c5ngggtw6brjmndie9fuquqo.snode

    $ ./loki-sn-keys restore key_ed25519-2
    Enter the Ed25519 secret key:
    3f078900bac5f3e97d5fe451a6e332826d29aae2e13fec895c1b527af88093c3

    Public key:      8f94f6bbc1d5876484309fc7fd41396c6bd66c4631a34f04895887547cb374dd
    X25519 pubkey:   f3e42d1aff8db8232433ec86e3f56cdda44d4c510144f9b6786520175b08c97f
    Lokinet address: t6kxpq6b4sdsjbbou9d94oj3pti7c5ngggtw6brjmndie9fuquqo.snode

    Is this correct?  Press Enter to continue, Ctrl-C to cancel.

    Saved secret key to key_ed25519-2

    $ ./loki-sn-keys restore-legacy key-2
    Enter the legacy SN private key:
    c8c17cc296c3e8bb603098b5d2535ad86662cdb24cd4c785c0485d0a490a2356

    Public key:      f3a513ddfbe946c79c62c27cca2260b80606a2da1b4f75ba16c793a5750a8510

    Is this correct?  Press Enter to continue, Ctrl-C to cancel.

    Saved secret key to key-2
2020-09-01 16:21:25 +10:00
Jason Rhinelander
d21d1ab15e
Enable lokid.sock by default and add umask (#1242)
This enables a LMQ RPC lokid.sock by default in the data directory, and
makes its permissions configurable by setting the LMQ umask value.
2020-09-01 14:24:25 +10:00
Jason Rhinelander
e21f7d88e3 Add more comments about keygen & clamping 2020-08-31 01:23:01 -03:00
Jason Rhinelander
9a4f40a092
Fix inverted logic on cache expiry (#1239)
This was resulting in spurious timeouts when multiple blinks are pending
quorum responses.
2020-08-31 11:42:29 +10:00
Jason Rhinelander
1b9d2bc212 Use only ed25519 key by default
We currently generate (for service nodes) both a /key and /key_ed25519
file: the former is a SN's primary monero privkey (i.e. the private key
point of an Ed25519 key, but with no seed so that it can't do full
Ed25519 signatures), the latter is a sodium standard seed+pubkey
concatenated file.

This commit makes lokid stop generate a new /key file: instead, if it
doesn't already exist, we calculate the private key point from the
ed25519 key and set that as the monero-style private key.  (The pubkeys
will be the same).

When a /key file exists, we continue to use it for the primary SN
keypair so that existing SN keys won't be affected.
2020-08-29 17:04:08 -03:00
javabudd
598c0b6784 Add mingw unbound to 32/64 bit windows documentation 2020-08-23 10:27:07 -03:00
Jason Rhinelander
4528d56169
Add optional parsed tx_extra info for mempool txes (#1236) 2020-08-20 14:16:37 +10:00