Commit Graph

22 Commits

Author SHA1 Message Date
Conrado Gouvea 956d8d3c7f
add benchmarks (#205)
* add benchmarks

* Apply suggestions from code review

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

* cargo fmt

---------

Co-authored-by: Marek <mail@marek.onl>
2023-01-30 18:48:13 +00:00
Conrado Gouvea b5e6da8820
clippy fixes (#212) 2023-01-09 21:23:59 +00:00
Conrado Gouvea ffe5c57a17
Expose internals to support randomization (simplified) (#152)
* changes required for randomization

* simplified version

* simplify compute_signature_share return

* add frost-rerandomized crate

* move rerandomized tests to frost-rerandomized from reddsa; remove unused deps

* Update frost-core/src/frost.rs

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2023-01-06 04:26:13 +00: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 359434b14f
docs cleanups (#194) 2022-12-08 17:42:47 +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 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
Conrado Gouvea 33b01a7d6f
Remove `as` keyword when not needed, use `Scalar`/`Element` shortcuts (#159)
* 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

* remove 'as' keyword when not needed

* use Scalar shortcut

* use Element shortcut

* remove more instances of 'as' keyword when not needed

* rustfmt

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-10-26 05:08:06 +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 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 8f2af1987c derive verification share and group public key from commitments 2022-09-19 15:24:21 -04: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 d1ddf72136
Make verification per-ciphersuite (#103)
* add VerifySignature method to Ciphersuite with default implementation

* VerifySignature -> verify_signature; fix comment

* add comment to verify_signature about batch verification

* fix batch support after rebase

* derive Eq when possible and disable clippy::derive_partial_eq_without_eq which is emitting false positives

* Make verify_prehashed() an associated method of the generic VerifyingKey

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-09-02 22:26:41 -04: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 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
Conrado Gouvea e1f466902c
Fix for P-256 support due to identity encoding; other improvements (#76)
* Remove AsMut bound which is not needed

* Use the generator point to get the encoded point size, since the identity in P-256 is just a single byte

* Remove FromHex bound

* Remove Default bound from Group
2022-06-27 21:47:27 +00: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