Commit Graph

270 Commits

Author SHA1 Message Date
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 09daa00fdf
Merge pull request #10 from ZcashFoundation/conversions
Add conversions for SecretKey -> PublicKey
2019-12-03 15:10:39 -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 1b7f1b0047
Merge pull request #9 from ZcashFoundation/parameterize
Make the signature type be a type parameter.
2019-12-03 12:26:30 -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 1a9569dca2 Add docs command. 2019-12-02 22:38:15 -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 fd5800065a Add blake2b_simd dependency 2019-12-02 21:19:07 -08:00
Henry de Valence 47ce9add3e Add jubjub dependency 2019-12-02 21:16:23 -08:00
Henry de Valence ecac1f8205 cargo new --lib 2019-12-02 14:12:06 -08:00