Commit Graph

21 Commits

Author SHA1 Message Date
StackOverflowExcept1on fc87f59cc0
chore(deps): improve organization of workspace (root Cargo.toml) (#874) 2025-02-17 14:10:41 +00:00
Conrado Gouvea f7dcad9c0b
Release 2.1.0 (#836) 2025-01-15 14:30:46 +00:00
conduition c88fadde8e
Add frost-secp256k1-tr crate (BIP340/BIP341) [moved] (#730)
* modify frost-core traits to enable taproot compatibility

This commit contains changes to the frost-core crate which
allow ciphersuites to better customize how signatures are computed.
This will enable taproot support without requiring major changes
to existing frost ciphersuites.

Co-authored by @zebra-lucky and @mimoo

This work sponsored by dlcbtc.com and lightspark.com

* add frost-secp256k1-tr crate and ciphersuite

Co-authored by @zebra-lucky and @mimoo

This work sponsored by dlcbtc.com and lightspark.com

* test coverage for taproot crate

Co-authored by @zebra-lucky and @mimoo

This work sponsored by dlcbtc.com and lightspark.com

* clippy fixes

* tweak DKG output to avoid rogue taproot tweaks

* add interoperability tests

* cleanup taproot implementation to minimize impact in frost_core

* Update PoK test vector to use nonce which generates an even-parity point

Uses r = e99ae2676eab512a3572c7b7655d633642a717250af57a7e0ccd5f9618b69f3f

* BIP341 key package tweaks shouldn't cause key negation

* prune the Context type, instead negate signature.R before verifying

With a couple of small adjustments to the code, we can remove the
need for this extra associated type on the Ciphersuite crate. Accepting
signature with odd-parity nonce values is OK, because BIP340 discard
the nonce parity bit anyway.

* proper TapTweak point-addition operates on even internal key representation

Thanks to @conradoplg for spotting this. The internal key is supposed
to be represented as an even-parity point when adding the TapTweak
point t*G. I added a regression test to ensure the tweaked verifying
key and its parity match the BIP341 spec.

* clippy test fixes

* fix no-std issues and warnings

---------

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
2024-11-14 13:50:18 +00:00
natalie 835a3f0cdc
Add refresh shares with dealer functionality (#665)
* Add refresh shares with dealer functionality (#245)

* Change refresh share API (#245)

Split refresh_shares_with_dealer into calculate_zero_key and refresh_share

* Fix serialisation error with refresh share (#245)

Add serialisation test

* Fix serialisation errors after updates (#245)

Fixed some typos

* Update refresh_share to accept and return a KeyPackage instead of SecretShare (#245)

* Tidy up refresh share functionality (#245)

* Add refresh share functionality to Book (#245)

Diagram is still to be added

* Update book for rereshing shares with trusted dealer (#245)

* Add new verifying shares calculation for refresh shares (#245)

Add tests for invalid identifiers when refreshing shares

* Rename calculate_zero_key to compute_refreshing_shares (#245)

* Import Vec from the alloc crate (#245)

This is to be compatible with the no_std attribute

* Use alloc crate instead of std for refresh shares (#245)

* Fix fmt error (#245)

* Refactoring refresh shares functionality (#245)

* cleanups during review

* Update book/src/tutorial/refreshing-shares.md

* update docs

* always return error in detect_cheater

* add changelog entry

---------

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2024-07-18 22:33:10 +00:00
Conrado Gouvea a0df08e30a
remove frost module (#568) 2023-10-31 16:30:05 +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 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 d4b03ea7bf
add default serialization format (#511)
* add default serialization format

* remove SHORT_ID from Ciphersuite trait
2023-09-13 12:58:26 +00:00
Conrado Gouvea 877e7c3830
fix clippy issues (#503) 2023-08-28 19:25:43 +00:00
Conrado Gouvea ba8086db5c
Simplify rerandomized FROST (#437)
* refactor Lagrange coefficient computation

* simplified rerandomized FROST

* switch to a Randomize trait, remove unaccurate comment

* remove manual rerandomization test

* improve comments

* removed unneeded alpha_share

* Apply suggestions from code review

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

* frost-rerandomized: add serde feature

* add Randomizer type

* revert DuplicatedIdentifiers back to DuplicatedIdentifier

---------

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2023-08-14 16:15:22 +00:00
Deirdre Connolly 404cc361fd
Include the group public key in computing the binding factor (#410)
* Prelim implementation of including the group public key in computing the binding factor

Needs updated test vectors from the spec PoC and updated tests

* update test vectors

* add integration_test.rs to gencode which we forgot to do before

---------

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
2023-07-05 13:19:19 +00:00
Conrado Gouvea 8531855bd7
implement common traits for public types (#422) 2023-06-30 19:15:56 +00:00
Conrado Gouvea 7358b667ca
expand serde tests (#409)
using samples in serde tests
2023-06-23 14:22:33 +00:00
Conrado Gouvea c851bbb8fa
Remove pub from fields, add getters (#401)
* derive getters; remove any existing ones; use BTreeMap for signing commitments

* add recreation tests

* make tests ciphersuite-specific
2023-06-23 14:07:34 +00:00
Conrado Gouvea c773edf452
expand list of gencode-generated files (#370) 2023-06-01 18:53:01 +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 c7751339cc
format Rust code generated by gencode (#367) 2023-05-31 20:08:12 +00:00
Conrado Gouvea cd74efa13d
gencode repairable improvement (#334)
* 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

* gencode: use frost-core repairable docs as canonical source
2023-05-02 15:12:04 +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 b829d4ff9f
move comments before attributes; make gencode handle them (#280) 2023-04-13 23:57:00 +00:00
Conrado Gouvea e5ecb2d3f4
renamed gendoc to gencode; make it unpublishable (#260) 2023-03-02 21:19:53 +00:00