Commit Graph

45 Commits

Author SHA1 Message Date
Deirdre Connolly 84d0fb60e2
Link to FROST security audit from module doc (#73) 2021-03-31 17:45:34 -04:00
Chelsea H. Komlo 76ba4ef1cb add additional documentation for aggregator threat model 2021-03-23 11:47:22 -04:00
Marek 6481d0af91 Add comments to the checks 2021-03-23 11:46:41 -04:00
Marek 3e28bf6c07 Avoid null nonces 2021-03-23 11:46:41 -04:00
Deirdre Connolly 5feb6b29c7
Fix some FROST nits (#63)
* Impl DefaultIsZeros for every type that uses jubjub::Fr/Scalar

This requires Copy and Clone along with Default. If we do not want to include those, we can impl Zeroize and Drop directly.

* Hash signature message with HStar before deriving the binding factor

To avoid a collision, we should hash our input message, our 'standard' hash is HStar, which uses a domain separator already, and is the same one that generates the binding factor.

* Add a comment about why we hash the signature message before generating the binding factor

* Add comments on how we Zeroize

* Consume nonces with sign()

We want to make sure that the nonces we use when signing are Drop'd
(and thus Zeroize'd) when they go out of scope, so we must move participant_nonces into sign()
2021-03-23 11:46:17 -04:00
Deirdre Connolly 2ebc08f910
Frost keygen with dealer (#47)
Implements FROST (Flexible Round Optimized Schnorr Threshold Signatures, https://eprint.iacr.org/2020/852) where key generation is performed by a trusted dealer. 

Future work will include implementing distributed key generation and re-randomizability. 

Co-authored-by: Chelsea Komlo <me@chelseakomlo.com>
Co-authored-by: Isis Lovecruft <isis@patternsinthevoid.net>
2021-02-25 09:06:54 -07:00
Henry de Valence 233294d701 Bump version to 0.2.2 2020-07-15 12:42:14 -07:00
Henry de Valence 7424cababb
Add batch::Item::verify_single and Item: Clone + Debug. (#39)
This closes a gap in the API where it was impossible to retry items in a failed
batch, because the opaque Item type could not be verified individually.
2020-07-15 12:38:43 -07:00
Henry de Valence cc50b23713 Bump version to 0.2.1 2020-07-09 11:52:30 -07:00
Henry de Valence eb5714779c release: update CHANGELOG and version. 2020-07-09 10:30:01 -07:00
Deirdre Connolly ba256655dd
Optimized batch verification (#36)
* Pulls in some traits and methods from curve25519-dalek around the
vartime multiscalar multiplication.

* Move scalar mul things we want to upstream to jubjub to their own crate

* Make Verify agnostic to the SigType

Co-authored-by: Henry de Valence <hdevalence@hdevalence.ca>
Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-07-03 18:23:28 -04:00
Deirdre Connolly f27b9c3c77
Change terminology to signing, verification keys (#35)
Matches ed25519-zebra.

Resolves #33
2020-06-25 11:56:29 -07:00
Henry de Valence aa023b428e Bump version and update changelog. 2020-01-17 10:28:12 -08:00
Henry de Valence b7dfb77cf1 Document Zcash consensus rules and fix mismatch.
The documentation for the `PublicKey` struct now explains which consensus rules
are checked by the conversion from `PublicKeyBytes`.
2020-01-17 10:13:51 -08:00
Henry de Valence 92cb99f966 Ensure SecretKey encoding is canonical. 2019-12-09 12:08:13 -08:00
Henry de Valence 87f09b87b5 Add Serialize, Deserialize for SecretKey. 2019-12-09 11:55:56 -08:00
Henry de Valence 2ca445ad23 Add Serialize, Deserialize to PublicKey. 2019-12-09 11:55:53 -08:00
Henry de Valence e58376fc47 Add Serialize, Deserialize for byte wrapper types. 2019-12-09 11:55:53 -08:00
Henry de Valence 798a3e4631 Fix trait bounds on SigType.
When Rust derives Copy, Clone, Eq, PartialEq, etc. on a type with
`PhantomData<T>`, it adds a `T: Clone` etc. bound, regardless of whether `T` is
only ever used inside of the `PhantomData`.  A better fix would be to fix the
derived bounds themselves, but in the meantime this works, even if it's
slightly ugly.
2019-12-09 11:55:53 -08:00
Henry de Valence 76eb4c5928 Update README, fill missing impls. 2019-12-04 17:36:01 -08:00
Henry de Valence ead4727ded Implement randomization. 2019-12-04 17:00:55 -08:00
Henry de Valence a3f0830bc1 Make Binding, SpendAuth enums so they show in a different Rustdoc section. 2019-12-04 16:41:16 -08:00
Henry de Valence 7b979ddd65 Add property tests for signatures. 2019-12-04 16:14:44 -08:00
Henry de Valence 19af25485b Clean warnings. 2019-12-04 11:59:31 -08:00
Henry de Valence 8bcfeae920 Add a basic test.
This ran into problems with Clone/Copy bounds -- it seems like the
derived impls require that the phantom type T also be Clone / Copy /
Debug for the type to be.  This commit does a hacky fix that makes it
work for now, but it should be cleaned up later.
2019-12-04 11:45:44 -08:00
Henry de Valence d761316579 Implement verification. 2019-12-04 11:45:37 -08:00
Henry de Valence d3b20d0f21 Store signature bytes in two parts. 2019-12-04 11:45:37 -08:00
Henry de Valence 2b37c71b57 Implement signing. 2019-12-04 11:45:30 -08:00
Henry de Valence 710ac6fba9 Add an hash-to-scalar implementation. 2019-12-04 11:45:30 -08:00
Henry de Valence b202a22826 Unfortunately keygen can't be a From impl because coherence rules. 2019-12-04 11:45:30 -08:00
Henry de Valence 84b042003b Add methods to the Sealed trait, simplifying types.
The motivation is as follows.  The sealed trait pattern allows creating
a type-level equivalent of an enum: the trait corresponds to the enum
type and its implementors correspond to the enum variants; the `Sealed`
restriction ensures that there is a fixed set of enum variants.

In this picture, adding methods to the public trait corresponds to a
public method on an enum, while adding methods to the private trait
corresponds to a private method on an enum.  This means that we can add
a method to get the basepoint (whose possible choices are enumerated by
SigType) and avoid having to do specialized impls.
2019-12-04 11:41:46 -08:00
Henry de Valence b44f149381 Reorganize data types. 2019-12-03 15:59:24 -08:00
Henry de Valence 52951f7236 Add keygen. 2019-12-03 15:39:55 -08:00
Henry de Valence 01cddd493b Add SecretKey -> PublicKey conversion. 2019-12-03 15:01:54 -08:00
Henry de Valence 06a0a6404d Serialize PublicKey, SecretKey 2019-12-03 14:51:38 -08:00
Henry de Valence 36b3842f3d fmt 2019-12-03 13:39:26 -08:00
Henry de Valence faebd2b783 Add byte encodings for Binding, SpendAuth basepoints.
These were extracted by adding printlns to the test suite for librustzcash.
2019-12-03 13:37:12 -08:00
Henry de Valence 6ca14abeec Make the signature type be a type parameter.
This means that using a BindingSig as a SpendAuthSig or vice versa becomes a
compile error.  Internally, we can share implementations, but having type
parameters and specialized impls means that the correct parameters can be
substituted in to whatever inner functions exist.
2019-12-03 12:22:35 -08:00
Henry de Valence eaaad6a0b8 Add rerandomization stub API. 2019-12-02 22:32:55 -08:00
Henry de Valence b094cd92b9 Stub out the sign/verify API. 2019-12-02 22:28:11 -08:00
Henry de Valence 580b310713 Add underivable impls to Signature. 2019-12-02 22:10:56 -08:00
Henry de Valence 156c6b6e7c Define main types for the library. 2019-12-02 21:58:19 -08:00
Henry de Valence 8bdb8580ff Add error stub 2019-12-02 21:36:47 -08:00
Henry de Valence c3fe237fe9 Add readme, module layout 2019-12-02 21:32:38 -08:00
Henry de Valence ecac1f8205 cargo new --lib 2019-12-02 14:12:06 -08:00