Commit Graph

188 Commits

Author SHA1 Message Date
Marek 46f8e2cb29 Fix integration tests
Some test were failing because they were not using the new identifiers, but were
trying to identify the participants by simple indices such as 1, 2, 3.
2021-08-01 20:21:15 +01:00
Marek 8eb3937f24 Change the byte order from big endian to little endian 2021-07-28 08:30:15 +01:00
Marek f052e8f37f Move the generation of identifiers into a separate function 2021-07-28 08:30:15 +01:00
Marek 63ee073a82 Bind identifiers to the secret chosen by the dealer 2021-07-28 08:30:15 +01:00
Marek 07a405a388 Change the type of the identifiers from u8 to u64 2021-07-28 08:30:04 +01:00
Deirdre Connolly 3db05e29f7 Remove extra module-level doc to allow doc = include_str to work 2021-06-22 16:37:36 -04:00
Alfredo Garcia 751af8a76b remove external_docs 2021-06-22 16:37:36 -04:00
Alfredo Garcia ced2819690 another try 2021-06-22 16:37:36 -04:00
Alfredo Garcia 79b8b52baa try to fix the docs build 2021-06-22 16:37:36 -04:00
dependabot[bot] 5105bcc865 Bump codecov/codecov-action from 1.5.0 to 1.5.2
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.5.0 to 1.5.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.5.0...v1.5.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 17:07:49 -04:00
Jack Grigg f772176560 jubjub 0.7 2021-06-18 14:05:08 -04:00
Alfredo Garcia fa3c602698
Implement the messages spec (#114)
* start messages and validation

* add missing docs to constants

* change validation to matches, fix constant doc

Co-authored-by: teor <teor@riseup.net>

* fix the build

* validate share_commitment

* add new constants and validations

* fix validation

* derive serde Serialize and Deserialize in all messages structs

* update created structs

Co-authored-by: teor <teor@riseup.net>

* fix build

* define and use a new MAX_SIGNERS constant

* change group_public type

* add some test cases

* add validation and serialization tests for SigningCommitments

* add validation and serialization test to SigningPackage

* change some fields order matching the spec

* fix field order in tests according to last updates to the spec

* implement serialize and deserialize for ParticipantId

* move serde-json to dev-dependencies section

* change to pub(crate)

* fix serialize of VerificationKey

* add assert to serialize

* add note, fix typo

* improve some code in tests

* test serialization of individual fields

* start messages and validation

* add missing docs to constants

* change validation to matches, fix constant doc

Co-authored-by: teor <teor@riseup.net>

* fix the build

* validate share_commitment

* add new constants and validations

* fix validation

* define and use a new MAX_SIGNERS constant

* change group_public type

* change some fields order matching the spec

* change message fields to new spec

* remove some non needed conversions

* use a BTreeMap to guarantee the order

* remove some calls to `clone()` by implementing `Copy`

* change message type in frost and add validate_signatureshare test

* change `share_commitment` to BTreeMap

* add `serialize_signatureshare` test

* add aggregatesignature tests

* add some test header messages utility functions

* add a setup utility

* move the general serialization checks into an utility function

* fi some typos

* add and use a `generate_share_commitment` utility

* add create_signing_commitments utility function

* improve the serialization tests

* make room for prop tests

* add arbitrary tests for serialization

* remove allow dead code from messages

* fix some imports

* make signature module public only to the crate

* simplify a bit the frost tests

* improve the generated docs

* add a `prop_filter` to Header arbitrary

* (ab)use proptest_derive

* improve validation for Message

* improve some utility functions

* change frost to serialization id conversion

* add a quick btreemap test

* change the `MsgType` to `u32`

* add no leftover bytes checks

* add a full_setup utility

* add map len checks

Co-authored-by: teor <teor@riseup.net>
2021-06-16 16:13:23 -03:00
Alfredo Garcia 00190de7c6 add missing checks
Co-authored-by: teor <teor@riseup.net>
2021-06-15 17:10:38 -04:00
Alfredo Garcia c0688b0fe4 Convert `share_commitment` to a BTreeMap
Co-authored-by: teor <teor@riseup.net>
2021-06-15 17:10:38 -04:00
Alfredo Garcia 7d357496fb use BTreeMap, update sizes, etc
Co-authored-by: teor <teor@riseup.net>
2021-06-15 17:10:38 -04:00
Alfredo Garcia 9d5e9fd547 change type to `SignatureResponse` 2021-06-15 17:10:38 -04:00
Alfredo Garcia b05edb8689 use FrostSignature instead of Scalar primitive 2021-06-15 17:10:38 -04:00
Alfredo Garcia a536404e59 update a field description 2021-06-15 17:10:38 -04:00
Alfredo Garcia 41a0bf5dad change some primitives to frost types 2021-06-15 17:10:38 -04:00
Alfredo Garcia d1c05626f3 change ParticipantId to u64 2021-06-15 17:10:38 -04:00
Alfredo Garcia 4bf0d5c58e text updates
Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2021-06-15 17:10:38 -04:00
Alfredo Garcia 08bda8503f put variable-length fields last in messages
Co-authored-by: teor <teor@riseup.net>
2021-06-15 17:10:38 -04:00
Alfredo Garcia 293801858d change group_public 2021-06-15 17:10:38 -04:00
Alfredo Garcia 46417a3dab forbid multi-bytes in serialization
Co-authored-by: teor <teor@riseup.net>
2021-06-15 17:10:38 -04:00
Alfredo Garcia 3e832df5f1 change some validation rules 2021-06-15 17:10:38 -04:00
Alfredo Garcia 3f3a04f958 remove `msg_type` validation rule 2021-06-15 17:10:38 -04:00
teor a57c12059e Make state-based validation out of scope 2021-06-15 17:10:38 -04:00
Alfredo Garcia 837af8d846 replace ParticipantID with ParticipantId everywhere remaining 2021-06-15 17:10:38 -04:00
Alfredo Garcia 63007330af fix definitions after changes to ParticipantID 2021-06-15 17:10:38 -04:00
Alfredo Garcia 6c3e8b3341 remove some spaces after newlines 2021-06-15 17:10:38 -04:00
Alfredo Garcia dc5f2da1d1 split doc comment in lines 2021-06-15 17:10:38 -04:00
Alfredo Garcia d3dc3b3438 fix missing msg names 2021-06-15 17:10:38 -04:00
teor 9529a8ee3e Clarify participant ID changes 2021-06-15 17:10:38 -04:00
teor df0ec420d4 Reserve specific participant IDs for the dealer and aggregator
Also explicitly identify the sender and receiver for each message.
2021-06-15 17:10:38 -04:00
teor 4f2b53d838 Add a constant for this serialization version 2021-06-15 17:10:38 -04:00
teor 0e77df1e40 Fix a missed type 2021-06-15 17:10:38 -04:00
teor 78a5cbade1 Remove the separate MsgCommitments type 2021-06-15 17:10:38 -04:00
teor 8bb106a53d Name, Doc and Serialization Tweaks, and a Test Plan 2021-06-15 17:10:38 -04:00
teor b0c5512a71 Fix a typo 2021-06-15 17:10:38 -04:00
Alfredo Garcia d9aa3bac88 add definitions 2021-06-15 17:10:38 -04:00
Alfredo Garcia 9ba0fe78c1 use some escape characters 2021-06-15 17:10:38 -04:00
Alfredo Garcia 4cc7365331 fix missing field name and type in MsgCommitments serialization 2021-06-15 17:10:38 -04:00
Alfredo Garcia 119e9013e0 split rules in header and payload sub sections 2021-06-15 17:10:38 -04:00
Alfredo Garcia 014dd22f86 add a new validation rules section 2021-06-15 17:10:38 -04:00
Alfredo Garcia 798d0ef7ea update serialization 2021-06-15 17:10:38 -04:00
Alfredo Garcia fc340edc28 add line to AffinePoint description 2021-06-15 17:10:38 -04:00
Alfredo Garcia 6aa6a68297 add a new not included item 2021-06-15 17:10:38 -04:00
Alfredo Garcia e9ca8ee99e update payloads rust code 2021-06-15 17:10:38 -04:00
Alfredo Garcia 8fcbb44908 change Participant to ParticipantID 2021-06-15 17:10:38 -04:00
Alfredo Garcia 4362f20732 fix typo 2021-06-15 17:10:38 -04:00