Commit Graph

52 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 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 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 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 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
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
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
Conrado Gouvea c80e812fb9
Update curve25519-dalek to 4.0.0-rc.1 (#261)
* Update curve25519-dalek requirement from =4.0.0-pre.1 to =4.0.0-rc.1

Updates the requirements on [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek) to permit the latest version.
- [Release notes](https://github.com/dalek-cryptography/curve25519-dalek/releases)
- [Changelog](https://github.com/dalek-cryptography/curve25519-dalek/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dalek-cryptography/curve25519-dalek/commits)

---
updated-dependencies:
- dependency-name: curve25519-dalek
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix breaking curve25519-dalek changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 16:03:33 +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 1815280576
Improve DKG API; add DKG example (#173)
* improve DKG API

* add DKG example; add ciphersuite-specific DKG functions
2022-11-18 12:54:06 +00:00
Conrado Gouvea e97257a6ca
remove random_nonzero from Field trait (#176) 2022-11-02 17:52:38 +00:00
Conrado Gouvea 6df6e32221
use Error everywhere and add enums as needed (#172)
* use Error everywhere and add enums as needed

* Apply suggestions from code review

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

* Update frost-core/src/error.rs

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

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-10-28 20:01:03 +00:00
Conrado Gouvea ac5f44ade8
add Ed25519 ciphersuite (#164)
* add Ed25519 ciphersuite

* clippy fixes

* fixes after rebase

* update share generation test name

* use max/min_signers

* expand authors

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-10-27 18:33:32 +00:00
Conrado Gouvea 201d6adc4d
use max_signers and min_signers instead of num_signers and threshold to better follow spec (#157) 2022-10-27 04:35:16 +00:00
Conrado Gouvea eca2101cf8
use u16 for number of signers (#156)
* use Identifier instead of index

* remove pub(crate) from the Identifier index

* Refreshed Identifier newtype of Scalar with traits

* Remove commented out lines

* add test vectors with indices larger than 1 byte

* add little_endian_serialize to implement Ord for Identifier

* use u16 for number of signers

* fix variable use

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-10-26 14:41:13 +00:00
Deirdre Connolly 255d79042a
Refreshed Identifier newtype of Scalar with traits (#114)
* use Identifier instead of index

* remove pub(crate) from the Identifier index

* Refreshed Identifier newtype of Scalar with traits

* Remove commented out lines

* add test vectors with indices larger than 1 byte

* add little_endian_serialize to implement Ord for Identifier

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
2022-10-25 23:50:25 -04:00
Conrado Gouvea d50cb30d23
Update test vectors and links to v11 (#151)
update test vectors and links to v11
2022-10-24 23:25:40 +00:00
Conrado Gouvea bceafae2e6
Add DKG support (#129)
* add DKG support

* refactor: call SecretShare::verify() in keygen_part3

* refactor: add generate_secret_polynomial and evaluate_polynomial

* refactor: factor out `evaluate_vss`

* refactor: factor out `compute_verifying_keys`

* fix full vector of coefficients not being returned

* simplify evaluate_polynomial to not receive constant term separately

* delete accidentally comitted .orig file

* Apply suggestions from code review

Co-authored-by: Marek <mail@marek.onl>

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

Co-authored-by: Marek <mail@marek.onl>

* fix doc warnings

Co-authored-by: Marek <mail@marek.onl>
2022-10-18 19:11:05 -03:00
Conrado Gouvea 28be955e38 merge SharePackage into SecretShare 2022-10-06 11:27:49 -04:00
Conrado Gouvea bea4ef0687
reject identity in Group::deserialize (#145) 2022-10-04 19:05:58 +00:00
Conrado Gouvea 828279d847
Hash serialized scalars entirely; update test vectors to V10 (#139)
* v9

* update to v10 vectors

* update spec links

* Make Rustdoc happy

* Make Rustdoc happy

* refactor coefficient generation into a function

* rustdoc

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-10-03 18:41:02 +00:00
Conrado Gouvea 45d16cb801
add H5; update to V8 (#137)
* add H5; update to V8

* Link H4

* Link H5

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-10-03 04:31:58 -04:00
Conrado Gouvea 66914e6f92
add ristretto255 docs (#110)
* add ristretto255 docs

* mention FROST(ristretto255, SHA-512) explicitly

* Update frost-ristretto255/src/lib.rs

* Update frost-ristretto255/src/lib.rs

* Update frost-ristretto255/src/lib.rs

* Update frost-ristretto255/src/lib.rs

* "# Security'

* rustfmt

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-09-19 19:59:14 +00:00
Conrado Gouvea d0c969d40a
rename keys::{Secret, Public} (#106)
* rename keys::{Secret, Public} to SecretShareValue, PublicVerificationShare

* Add SharedSecret; rename types to SigningShare, VerifyingShare

* Tidy rustdoc

* round2 rustdoc

* Happy rustdoc

* Remove commented out random() associated function for SigningShare

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-09-15 16:15:53 +00:00
Conrado Gouvea 86e1218fa9
use Identifier instead of index (#96)
* use Identifier instead of index

* remove pub(crate) from the Identifier index

* A comment

* Whitespace for readability

* check for zero in Identifier::to_scalar()

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-09-01 17:07:50 -03:00
Deirdre Connolly 866fdefb20
CI: Clippy, linting, check rustdoc, etc (#104)
* Clippy, linting, check rustdoc, etc

* Ignore frost-redjubjub in the workspace for now

* Make rustfmt happy

* Clippy

* Appease Clippy

* Comment out bench for now
2022-08-03 23:04:37 -04:00
Conrado Gouvea 2e8509837c
Fix clippy lints (#88)
fix clippy lints
2022-08-02 01:46:11 +00:00
Deirdre Connolly 4cb11ec393
V5 (#89)
* add commit(), use it instead of preprocess()

* use a single scalarmul in compute_group_commitment per v5 spec

* add nonce_generate() from the spec and use it

* remove Order() from Group trait since it's not used

* style: carriage return

* use Secret instead of KeyPackage in some methods

* change commit to take explicit params and not return vectors

* removed unused import

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
2022-07-19 20:17:20 +00:00
Deirdre Connolly a0bf3c57f2
Port frost-ristretto255 to frost-core (#57)
* Start port to frost-core

* Fix Signature from_bytes, frost-ristretto255 README / src/lib.rs doc test

* Move frost-ristretto255 test vector tests to that crate

* Uncomment proptest checks to exercise signature and verifying key (de)serialization

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-06-17 14:54:54 -04:00
Deirdre Connolly e6d5afdfb2
Merge pull request #50 from ZcashFoundation/frost-core
* frost-core Cargo.toml

* Ciphersuite trait

* Signature trait

* Copy stub ristretto impl for now

* First stab at making signing and verifying generic over frost-core::Ciphersuite

* Update signing

* Nice const generics and stuff for frost-core::Ciphersuite

* Have to implement traits for the pre-parameterized types inside the module

* Ciphersuite::Group::Field

* Make frost/keys generic over Ciphersuite

* frost-core genericization mostly done, modulo batch

* Move tests around

* Remove internal test module

* Lots of tidies, including type refinement of Scalar, Challenge

* More genericization and tidy'ing

* Test vectors working against Ristretto impl in the frost-core integration tests

* clippy fix

* Fix generic params for full frost example integration test using ristretto

* Genericize proptests

* clippy --fix

* Doc comment identifier module

* In-flight batch and multiscalar mul

* Stop using Scalar::from_hash() as it expects impl Digest which sha2 0.10+ isn't doing anymore

* run cargo udeps

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

* Update frost-core/src/frost.rs

* Update frost-core/src/frost/keys.rs
2022-05-16 16:53:17 -04:00
Deirdre Connolly fcd4599ec5 Some docs 2022-03-28 15:46:48 -04:00
Deirdre Connolly a41c02581d We no longer H3(msg) to create the challange, only to create the binding_factor 2022-03-03 12:55:45 -05:00
Deirdre Connolly bf8b138595 Small fixes, trying to get test vector sig share verification working 2022-03-03 12:55:45 -05:00
Deirdre Connolly 77bb412c7a A bunch of fixes 2022-03-03 12:55:45 -05:00
Deirdre Connolly c59d36d508 Turn several functions into type methods, impl FromHex for some for test vectors 2022-03-03 12:55:45 -05:00