Commit Graph

38 Commits

Author SHA1 Message Date
Conrado Gouvea e69002e0f6
re-export serde in ciphersuite crates (#573) 2023-11-10 17:27:41 +00:00
Conrado Gouvea a0df08e30a
remove frost module (#568) 2023-10-31 16:30:05 +00:00
Conrado Gouvea 71c092532c
add computing PublicKeyPackage from commitments (#551)
* Refactor computing the public key package and expose it.

* Fix clippy issue.

* Add test.

* Fix test.

* Improve test.

* Split it up.

* Fix build.

* Improve api.

* Expose more stuff.

* Expose more stuff.

* Extract proof of knowledge verification.

* Add construct_proof_of_knowledge.

* fix dkg test

* overall cleanup

* change IncorrectCommitment to IncorrectNumberOfCommitments

* clippy fixes

* fix order of inputs for DKG commitment hashing

* also change regular challenge() verifying key argument to VerifyingKey

---------

Co-authored-by: David Craven <david@craven.ch>
2023-10-27 11:48:54 +00:00
Conrado Gouvea c0c57f4b4b
generate Randomizer by hashing SigningPackage (#542) 2023-09-22 14:20:11 +00:00
natalie ba3ef7dbb8
Convert all HashMaps to BTreeMaps (#547)
Convert HashMaps to BTreeMaps (#476)
2023-09-22 14:08:32 +00:00
Conrado Gouvea a5dc479b4d
remove serde bounds from Ciphersuites (#541) 2023-09-21 09:24:21 +00:00
Conrado Gouvea 4ba88c0210
add version field to serialization at the beginning; move ciphersuite after it (#540)
* add version field into a Header field along with the ciphersuite ID

* Change Ciphersuite ID to be the contextString from the spec

* Apply suggestions from code review

Co-authored-by: natalie <n.l.eskinazi@gmail.com>

---------

Co-authored-by: natalie <n.l.eskinazi@gmail.com>
2023-09-20 15:40:01 +00:00
Conrado Gouvea 9752182fa1
change reconstruct() to take KeyPackages; validate size (#523)
change reconstruct() to take KeyPackages; validate size
2023-09-11 21:51:33 +00:00
Conrado Gouvea 4abe7fe638
document features (#512) 2023-09-04 19:38:48 +00:00
Conrado Gouvea fcd0e31e6b
return error when validating an empty batch (#487)
* return error when validating an empty batch

* reuse n
2023-09-02 05:13:51 +00:00
natalie bb94a34362
Add minimum participant constraints (#453)
* Add validation for missing identifier in signing package (#442)

* Add error handling for identifier having an invalid commitment (#442)

* Fixed comment (#442)

* Add validation for participant numbers (#443)

Add to split() and generate_secret_polynomial()

* Add participant validation for dkg and repairable (#443)
2023-08-16 18:38:29 +00:00
Conrado Gouvea 9413b49c05
Update test vectors (#438)
update test vectors to final version (v1) and update spec links
2023-08-14 10:39:15 +00:00
Conrado Gouvea 9b5d88da72
refactor Lagrange coefficient computation (#436)
* refactor Lagrange coefficient computation

* A line

* Apply suggestions from code review

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>

* address review comments; make compute_lagrange_coefficients() not pub by default

---------

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2023-07-19 16:47:09 +00:00
Conrado Gouvea b8ca1678a4
remove stale TODOs (#431) 2023-07-05 13:19:25 +00:00
Conrado Gouvea b2c605aac1
remove identifiers from structs that are communicated (#397)
* WIP of removing the identifier in structs that are communicated. Working for SigningCommitments for ristretto255

* removed identifier from SignatureShare

* remove identifiers from DKG packages

* replicate to other ciphersuites; simplify SignatureShare

* update changelog

* fix SignatureShare encoding
2023-07-05 10:39:25 +00:00
Conrado Gouvea 4e134f50d6
allow specifying identifiers in generate_with_dealer (#419) 2023-06-30 18:29:26 +00:00
Conrado Gouvea 78b5c44de0
add support for deriving identifiers from arbitary strings (#418) 2023-06-30 15:45:46 +00:00
Conrado Gouvea 7358b667ca
expand serde tests (#409)
using samples in serde tests
2023-06-23 14:22:33 +00:00
Conrado Gouvea 47121537e8
Support serde (#398)
* Implement serde for network messages.

* Make sure marker type implements serde.

* add serde support to all required structs

* use serdect

* gate under serde feature

* ci: add build with default features job

* add serde tests and required changes/fixes

* add support for encoding ciphersuite ID

---------

Co-authored-by: David Craven <david@craven.ch>
2023-06-23 09:58:22 +00:00
Conrado Gouvea 8defd2c058
expose missing structs in ciphersuite crates (#405)
expose VerifyingShare, NonceCommitment and SignatureResponse in ciphersuite crates
2023-06-22 09:26:56 +00:00
natalie c03402baa5
Expose signing share in ciphersuite libraries (#404)
* Add SigningShare to ciphersuite libraries (#403)

* Update ciphersuite libraries to use own implementation of SigningShare and not generic (#403)
2023-06-21 16:51:50 +00:00
natalie 2668555f38
Refactor test folders (#366)
* move test functions that differ from other ciphersuites to make gencode simpler to use (#364)

* Refactored folder structure for ristretto255 (#364)

* Add batch and signing tests folders to ristretto255 (#364)

* Refactor test folders for ed25519 (#364)

* Refactor test folders for ed448 (#364)

* Refactor test folders for ed448 (#364)

* Refactor test folders for secp256k1 (#364)

* Refactor test folders for frost-core (#364)

Update ciphersuites due to refactoring in core

* Update coverage tool to exclude new test files (#364)

* Rename signing_tests to ciphersuite_generic_tests to match frost-core (#364)

* Set default branch as main in codecov (#364)

* Fix incorrect file name in gencode (#364)

* Remove test file targets in gencode and replace with only md files (#364)

* Rename helper_functions to helpers (#364)

Remove unecessary test traits

* Rename ciphersuite tests (#364)

* Rename test_helpers to helpers (#364)

* move tests to integration_tests (#364)

* Re-add dkg.rs and repairable.rs to gendoc (#364)

* Refactored rest of ciphersuite integration tests (#364)

* Fix fmt in gencode (#364)
2023-05-31 21:23:29 +00:00
Conrado Gouvea 6bca7a3918
add split_key; additional refactorings (#314)
* add split_key; additional refactorings

* Update frost-core/src/frost/keys.rs

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>

* refactor reconstruct_key(); add tests for error cases

* rename keys functions

* leftover renames after sync with main

---------

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2023-05-19 09:54:52 +00:00
Conrado Gouvea 4a112230cb
Change gencode to handle repairable module; fix build issues (#329)
* make gencode generate repairable.rs

* fix build issues in ciphersuite-specific repairable.rs

* copy repairable docs from frost-core into ciphersuites modules

* use full ciphersuite name in repairable.rs to make gencode work
2023-04-28 02:16:03 +00:00
Conrado Gouvea 98836fad4d
remove redundant round2::SigningPackage (#333) 2023-04-27 21:52:38 +00:00
natalie 0b981618cd
Add repair share functionality (#281)
* Add compute random value function for repair share functionality (#41)

This is step 1 of 3

* Add compute random value function for repair share functionality for each ciphersuite (#41)

* Add compute_sum_of_random_values function for repair share functionality (#41)

This is step 2 of 3

* Add recover_share function for repair share functionality (#41)

This is step 3 of 3

* Add communication rounds functions for repair share functionality for each ciphersuite (#41)

Add compute_sum_of_random_variables function
Add recover_share function

* Fix recover_share tests so they test the right thing

Fix secp256 recover share test values
Fix ristretto255 recover share test values
Fix ristretto255 compute sum of random values test values

* Rewrite compute_random_values to generate_random_values for repair share functionality (#41)

Test generate_random_values directly
End to end test to be added in another commit
Updated gendoc to use original file values to fix clippy complaints

* Rename functions and update documentation for repair (#41)

* Add end to end test for repair share (#41)

Fix lagrange coefficient calculation

Co-authored-by: conrado <conradoplg@gmail.com>

* Fix formatting (#41)

* Remove comment (#41)

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Update documentation for step 1 of RTS (#41)

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Update documentation for method of computing step 1 of RTS (#41)

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Rename repair share functions (#41)

* Improve documentation for Repairable Threshold Scheme (#41)

* Remove unecessary code from repairable tests (#41)

* Update repairable documentation

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Rename steps in repairable to be more consistent with DKG pattern (#41)

* Update gitignore (#41)

* Update repairable to use new keygen_with_dealer signature (#41)

* Update frost-core/src/frost/keys/repairable.rs

---------

Co-authored-by: conrado <conradoplg@gmail.com>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2023-04-24 15:27:14 +00:00
Deirdre Connolly cf7ebcb34e
Re-export the frost-core traits and rand-core as part of top-level impls API (#297)
* Re-export the frost-core traits and rand-core as part of top-level impls API

* Don't export frost_core::frost

---------

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
2023-04-14 01:04:17 +00:00
Conrado Gouvea b829d4ff9f
move comments before attributes; make gencode handle them (#280) 2023-04-13 23:57:00 +00:00
natalie c6f2d6b5fb
Update keygen_with_dealer to return a hashmap (#288)
* Change keygen_with_dealer to return a HashMap (#282)

Update docs

* Add vscode folder to gitignore
2023-03-23 22:24:33 +00:00
Deirdre Connolly 49de544c69
Upgrade k256 and p256 dependencies (#262)
* Upgrade k256, remove & replace hash_to_field with hash2curve::hash_to_field

* Upgrade p256 to 0.13.0

* Remove now-redundant PrimeCurveAffine trait import

* DRY up hash_to_scalar()
2023-03-08 14:32:35 +00:00
Conrado Gouvea dc3544e5d9
rename DKG types (#256) 2023-03-01 23:12:31 +00:00
Conrado Gouvea 0fffd6517d
fix Identifier ordering; add big identifier test vectors (#197) 2023-01-02 22:43:27 +00:00
Conrado Gouvea 665ab512e2
move dkg module to its own file; update and refactor gendoc (#196)
* move dkg module to its own file; update and refactor gendoc

* pin curve25519-dalek for now due to breaking changes
2022-12-15 09:38:48 +00:00
Conrado Gouvea 2967cae5e4 refactor hash implementations with hash_to_array/scalar functions 2022-12-14 00:49:20 -05:00
Conrado Gouvea e8dc692ca0
add Identifier to InvalidSignatureShare and split Error type (#183)
* add Identifier to InvalidSignatureShare

* rustdoc

* also update secp256k1

* add Identifier::deserialize; make serialize public

* make it work with Ed448

* Some space

* Fixing spacing for rustfmt

* Revert  🤦‍♂️

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-12-12 22:04:10 +00:00
Conrado Gouvea 1d06341f5c
Remove unused dependencies (#191)
remove unused dependencies
2022-12-07 15:40:17 +00:00
Conrado Gouvea d8700fed06
add gendoc --check, use in CI (#184)
* add gendoc --check, use in CI

* ran gendoc
2022-11-25 00:36:34 +00:00
Conrado Gouvea 3e1fe25dbd
add secp256k1 ciphersuite (#175)
* add secp256k1 ciphersuite

* use workaround for hash2field

* fix secp256k1 docs caused by gendoc bug

* Apply suggestions from code review

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>

* removed random_nonzero which is no longer needed

* typo

* cargo fmt

* rustdoc url

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-11-22 21:09:21 +00:00