Commit Graph

66 Commits

Author SHA1 Message Date
Henry de Valence eb5714779c release: update CHANGELOG and version. 2020-07-09 10:30:01 -07:00
Deirdre Connolly b521ffb17f Fix benches 2020-07-05 00:22:08 -04: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
dependabot-preview[bot] c933a8eb85 Create Dependabot config file 2020-06-09 16:27:11 -04:00
dependabot-preview[bot] 1179d50fa8 Update proptest requirement from 0.9 to 0.10
Updates the requirements on [proptest](https://github.com/altsysrq/proptest) to permit the latest version.
- [Release notes](https://github.com/altsysrq/proptest/releases)
- [Changelog](https://github.com/AltSysrq/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/altsysrq/proptest/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 16:25:28 -04:00
Henry de Valence 18dfb01c7e
Merge pull request #22 from ZcashFoundation/fix-ci
Use plain actions-rs for CI
2020-01-17 14:00:51 -08:00
Henry de Valence 3d7dddc03f use plain actions-rs for CI 2020-01-17 13:58:17 -08:00
Henry de Valence 91b5e8a258 Merge branch 'release/0.1.1' into main 2020-01-17 10:29:23 -08:00
Henry de Valence aa023b428e Bump version and update changelog. 2020-01-17 10:28:12 -08:00
Henry de Valence 416ec245cf Merge branch 'release/0.1' into main
This should have happened at release time.
2020-01-17 10:26:39 -08:00
Henry de Valence a786d272f0
Merge pull request #19 from ZcashFoundation/smallorder-pubkey
Document Zcash consensus rules in PublicKeyBytes to PublicKey conversion.
2020-01-17 10:16:35 -08:00
Henry de Valence 5d3dfc0ff2 Add test that public keys of small order are rejected. 2020-01-17 10:13:51 -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
Deirdre Connolly cf715f5221 Add Dockerfile for gcloud build 2019-12-09 18:32:56 -05:00
Deirdre Connolly b3b6894fde Add GitHub Actions workflow which runs Google Cloudbuild jobs 2019-12-09 18:32:56 -05:00
Henry de Valence 68deca90bf crates.io only allows 5 keywords 2019-12-09 13:58:42 -08:00
Henry de Valence 16659efaad Add CHANGELOG.md for 0.1.0 2019-12-09 13:56:22 -08:00
Henry de Valence 5be929559b
Merge pull request #17 from ZcashFoundation/rename
Rename to just `redjubjub`.
2019-12-09 13:54:55 -08:00
Henry de Valence c20139bbf7 Rename to just `redjubjub`. 2019-12-09 13:54:10 -08:00
Henry de Valence 570cca07b5 Update Cargo.toml metadata 2019-12-09 13:20:56 -08:00
Henry de Valence d8ad15059d Try to prevent ChangePubkey tweaks from becoming a no-op.
Since we expect the signature to fail if ChangePubkey is applied, we need to
make sure it actually changes the signature test case.
2019-12-09 12:15:11 -08:00
Henry de Valence a15b4721be
Merge pull request #16 from ZcashFoundation/canonical-secrets
Ensure SecretKey encoding is canonical.
2019-12-09 12:09:58 -08:00
Henry de Valence 92cb99f966 Ensure SecretKey encoding is canonical. 2019-12-09 12:08:13 -08:00
Henry de Valence 80239164f2
Merge pull request #15 from ZcashFoundation/serde 2019-12-09 11:59:16 -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 27a1d73891
Merge pull request #13 from ZcashFoundation/randomize
Implement randomization.
2019-12-04 17:02:06 -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 2c3b411362
Merge pull request #12 from ZcashFoundation/proptest
Add property tests, librustzcash test vectors.
2019-12-04 16:36:59 -08:00
Henry de Valence e3e92af63b Add more signature tweaks to proptest. 2019-12-04 16:35:25 -08:00
Henry de Valence 8aeb2f14f8 Add test vectors from librustzcash.
The `SpendAuth` test vectors were generated using
`FixedGenerators::SpendingKeyGenerator`, and the `Binding` test vectors
were generated using `FixedGenerators::ValueCommitmentRandomness`.
2019-12-04 16:14:44 -08:00
Henry de Valence 7b979ddd65 Add property tests for signatures. 2019-12-04 16:14:44 -08:00
Henry de Valence f169ef06ed Use published Jubjub. 2019-12-04 12:00:26 -08:00
Henry de Valence 19af25485b Clean warnings. 2019-12-04 11:59:31 -08:00
Henry de Valence 24d856de2c
Merge pull request #11 from ZcashFoundation/signverify
Implement sign, verify operations.
2019-12-04 11:51:35 -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 09daa00fdf
Merge pull request #10 from ZcashFoundation/conversions
Add conversions for SecretKey -> PublicKey
2019-12-03 15:10:39 -08:00