Commit Graph

998 Commits

Author SHA1 Message Date
Luke Parker
90fccc444b Remove .is_some() unwraps for if let Some 2022-05-18 01:08:54 -04:00
Luke Parker
7c0886a113 Support signing Monero TXs with multiple inputs
Remove's CLSAG's msg Rc for the msg available through AlgorithmMachine. 
Potentially slightly more inefficient, as it needs to be converted from 
a slice to a [u8; 32], yet removes a re-impl.

Also removes a match for an if.
2022-05-18 00:53:13 -04:00
Luke Parker
3a13f80bdd Patch for previous commit 2022-05-17 19:51:04 -04:00
Luke Parker
fd0fd77cf5 Simplify Monero key image handling 2022-05-17 19:15:53 -04:00
Luke Parker
dcd909a839 Allow offsetting FROST keys multiple times 2022-05-14 15:04:08 -04:00
Luke Parker
3f02ab3037 Optimize decoy selection by batching the get_outputs call per input 2022-05-14 02:12:54 -04:00
Luke Parker
bf4d83ba70 Remove simd_backend as a used dalek feature
It's great performance yet not mandatory.
2022-05-14 00:59:14 -04:00
Luke Parker
94bd30083b Slightly simplify CLSAG signing
Expands its test to test all possible ring indexes, though just 0 and a 
single n would be sufficient.
2022-05-14 00:45:13 -04:00
Luke Parker
0aeab04c70 Move Rust definitions of C functions to their respective files 2022-05-13 20:26:53 -04:00
Luke Parker
3533e66c7f Add Rust CLSAG verification
Marked experimental, not guaranteed to match Monero yet
2022-05-13 20:26:29 -04:00
Luke Parker
bb840da44d Get Monero tests to pass on a brand new network
Updates decoy selection with an explicit panic, the removal of a divide 
by 0 (causing tests to fail on new chains), and a minor optimization 
when dealing with a large quantity of locked outputs.

Also increases documentation, acknowledging infinite loops and breakage 
from Monero more.
2022-05-13 00:05:34 -04:00
Luke Parker
3e7598315c Reorganize CLSAG sign flow 2022-05-06 19:07:37 -04:00
Luke Parker
a541903895 Replace the term mixin with decoy
https://libera.monerologs.net/monero-research-lab/20211002#c34977
2022-05-06 08:12:30 -04:00
Luke Parker
3dab26cd94 Correct discrepancies with the IETF draft
While all the transcript/extension code works as expected, which means, 
they don't cause any conflicts, n was still capped at u64::MAX at 
creation when it needs to be u16. Furthermore, participant index and 
scalars/points were little endian instead of big endian/curve dependent.
2022-05-06 07:49:18 -04:00
Luke Parker
b443747994 Remove more specific versions from the monero package 2022-05-06 07:33:44 -04:00
Luke Parker
964cb357e6 Use a global transcript 2022-05-06 07:33:08 -04:00
Luke Parker
cc9c2e0d40 Use dom-sep tags in the transcripts
Also simplifies form in some places
2022-05-06 01:35:23 -04:00
Luke Parker
0f481773df Use a gamma distribution for mixin selection 2022-05-04 08:18:43 -04:00
Luke Parker
f856faa762 Implement simple random mixin selection which passes sanity 2022-05-04 06:24:52 -04:00
Luke Parker
9a42391b75 Cleanup which makes transcript optional, only required for multisig 2022-05-03 08:49:46 -04:00
Luke Parker
56fc39fff5 Fix https://github.com/serai-dex/serai/issues/5 2022-05-03 07:42:09 -04:00
Luke Parker
bf257b3a1f Transcript crate with both a merlin backend and a basic label len value backend
Moves binding factor/seeded RNGs over to the transcripts.
2022-05-03 07:20:24 -04:00
Luke Parker
87f38cafe4 Rename sign folder to crypto
Inspired by #3 and #5.
2022-05-03 00:46:50 -04:00
Luke Parker
9ccf683e9d Working multisig TXs 2022-04-30 04:32:19 -04:00
Luke Parker
d6649fffb1 Merge InputMultisig into Multisig
There's no reason to use the latter.
2022-04-30 01:43:15 -04:00
Luke Parker
22ac5ce3b6 Update the CLSAG multisig API for TX signing 2022-04-30 01:41:05 -04:00
Luke Parker
d0506e2e9b Make a trait out of sign::StateMachine for more complex Transaction flows 2022-04-29 22:36:43 -04:00
Luke Parker
27396a6291 Implement a CLSAG algorithm extension which also does key images
Practically, this should be mergeable. There's little reason to do a 
CLSAG and not also a key image. Keeps them isolated for now.
2022-04-29 22:03:34 -04:00
Luke Parker
45559e14ee Various corrections to multisig API 2022-04-29 15:28:04 -04:00
Luke Parker
3a4971f28b Update the Algorithm API for greater flexibility
Also updates the extensions made to the binding nonce to prevent crafted 
messages from creating identical binding factors despite being distinct.
2022-04-29 01:34:48 -04:00
Luke Parker
8821eb0984 Consolidate FROST testing code 2022-04-28 21:47:25 -04:00
Luke Parker
777bb3df34 Add a send test 2022-04-28 20:41:43 -04:00
Luke Parker
1d0a0c7c16 Clean up code, correct a few bugs, add leader based one-time-key/BP gen 2022-04-28 20:09:31 -04:00
Luke Parker
c4b7cb71d7 Move SignableInput to clsag::Input 2022-04-28 17:29:56 -04:00
Luke Parker
7ed1fca270 Use a SeedableRng for CLSAG multisig signing 2022-04-28 17:12:54 -04:00
Luke Parker
20f214c300 Update CLSAG multisig to work again 2022-04-28 12:01:20 -04:00
Luke Parker
f3a5e3c27e Implement TX creation
Updates CLSAG signing as needed. Moves around Error types.

CLSAG multisig and the multisig feature is currently completely borked 
because of this. The created TXs are accepted by Monero nodes.
2022-04-28 03:31:09 -04:00
Luke Parker
b10b531311 Correct the placement of the wrapper rebuild in the build script 2022-04-27 22:49:18 -04:00
Luke Parker
a37a21f891 Rename monero-sign to monero-serai 2022-04-27 22:48:58 -04:00
Luke Parker
c9537a08a1 Files meant for the previous commit 2022-04-27 00:09:25 -04:00
Luke Parker
df4be9ca0c Move the Monero create to coins/
Includes misc bug fixes
2022-04-27 00:09:05 -04:00
Luke Parker
79f39c4433 Simplify Monero build script 2022-04-26 22:59:20 -04:00
Luke Parker
3c98e85c0a Futher document hash_msg 2022-04-23 12:59:53 -04:00
Luke Parker
afdac8c49b Fix clsag context and handle the OUT_DIR changing
Also rearranges arguments a bit.
2022-04-23 03:59:21 -04:00
Luke Parker
e22dcb1441 Update FROST signing to match the IETF draft
Modernizes dependencies
2022-04-23 03:49:30 -04:00
Luke Parker
76a6ff46be Include the scalar offset in the calculation of p 2022-04-22 22:26:08 -04:00
Luke Parker
7421ed96ff Move the Validators protocol spec doc in
Updates it as applicable
2022-04-21 22:01:12 -04:00
Luke Parker
6101f81d0a Initial commit
Combines the existing frost-rs, dalek-ff-group, and monero-rs repos into 
a monorepo. Makes tweaks necessary as needed. Replaces RedDSA (which was 
going to be stubbed out into a new folder for now) with an offset system 
that voids its need and allows stealth addresses with CLSAG.
2022-04-21 21:36:18 -04:00