Commit Graph

1172 Commits

Author SHA1 Message Date
Jack Grigg 687fff5ecf bls12_381: Fix ambiguous operation clippy warnings 2020-01-14 20:59:25 -05:00
Jack Grigg e15fea2757 bls12_381: Silence clippy::eq_op in tests that trigger it
The tests are explicitly checking that the operator implementations work
correctly for equal LHS and RHS.
2020-01-14 20:53:44 -05:00
Jack Grigg 394b6f91a9 bls12_381: Use readable literals 2020-01-14 20:51:34 -05:00
Jack Grigg 6c6772e456 jubjub: Allow too-many-arguments in Fr::montgomery_reduce 2020-01-14 10:55:42 -05:00
Jack Grigg 7a8fe98b27 jubjub: Remove unnecessary references 2020-01-14 10:55:24 -05:00
Jack Grigg 4c9793d001 jubjub: Use readable literals 2020-01-14 10:55:00 -05:00
Jack Grigg 9c485cc97e Move from CurveProjective::add_assign_mixed to traits 2020-01-13 21:20:46 -05:00
Jack Grigg d822e34e63 Extract curve operations into default impl traits
This makes it possible to implement mixed addition using operator-backed
traits without running into type annotation problems.
2020-01-13 21:19:33 -05:00
Jack Grigg 1a8ec21c03 Move from Curve*::negate to Neg operator 2020-01-13 21:19:33 -05:00
Jack Grigg 8193324986 Move additive CurveProjective operators to traits 2020-01-13 21:19:33 -05:00
str4d 049847f1a8
Merge pull request #195 from str4d/criterion-benchmarks
Migrate all benchmarks to criterion
2019-12-19 18:09:57 -06:00
Jack Grigg 8f48ded2a1
Move benchmark bitrot linter out of nightly lints 2019-12-19 16:49:12 -06:00
Jack Grigg 6c2c2b58de
Migrate pairing benchmarks to criterion 2019-12-19 16:46:16 -06:00
Jack Grigg 00499b3441
Migrate zcash_primitives benchmarks to criterion 2019-12-19 16:11:11 -06:00
Jack Grigg 7ea1da5d6f
Migrate jubjub benchmarks to criterion 2019-12-19 15:55:01 -06:00
Jack Grigg f44556d7bf
Upgrade to criterion 0.3 2019-12-19 15:08:45 -06:00
str4d b5523f610e
Merge pull request #194 from str4d/ct-invert
Constant-time field inversion in ff_derive using pow_vartime
2019-12-19 14:33:41 -06:00
Jack Grigg 56999d0f73
Constant-time field inversion in ff_derive using Field::pow_vartime
This is around 2.5-3x slower than the non-constant-time inversion. We
can regain some of this speed later by dynamically generating addition
chains.
2019-12-19 12:25:39 -06:00
Jack Grigg 26ef9c9842
Pass modulus to prime_field_constants_and_sqrt by reference 2019-12-19 12:18:09 -06:00
ebfull f5914fe804
Merge pull request #192 from str4d/ff-pow_vartime-and-no_std
ff::Field::pow_vartime and no_std support
2019-12-19 08:56:02 -07:00
Jack Grigg ec2c304efd
no_std support for ff crate 2019-12-14 12:55:34 +00:00
Jack Grigg 1c9f5742fa
Improve Field::pow API and impl
Renamed to Field::pow_vartime to indicate it is still variable time with
respect to the exponent.
2019-12-14 12:27:48 +00:00
str4d e88e2a9dc2
Merge pull request #191 from str4d/ff-ct-inv-and-sqrt-apis
Constant-time APIs for ff::Field::[invert, sqrt]
2019-12-13 22:29:50 +00:00
Jack Grigg 3d2acf48ce
Constant-time field square root
WARNING: THIS IS NOT FULLY CONSTANT TIME YET!

This will be fixed once we migrate to the jubjub and bls12_381 crates.
2019-12-13 20:13:30 +00:00
Jack Grigg 40749da9a7
Constant-time field inversion
WARNING: THIS IS NOT ACTUALLY CONSTANT TIME YET!

The jubjub and bls12_381 crates will replace our constant-time usages,
but we NEED to fix ff_derive because other users will expect it to
implement the Field trait correctly.
2019-12-13 19:46:04 +00:00
str4d e85a9f309f
Merge pull request #190 from str4d/ff-more-ops
More ff::Field operator refactoring
2019-12-13 18:53:07 +00:00
Jack Grigg 662be3551f
impl ConditionallySelectable for Field 2019-12-12 23:15:48 +00:00
Jack Grigg cded08b0c5
Make Field::square take &self and return Self 2019-12-12 23:09:28 +00:00
Jack Grigg 9dac748224
Make Field::double take &self and return Self 2019-12-12 22:59:18 +00:00
Jack Grigg 91c32f1c7c
Move from Field::negate to Neg operator 2019-12-12 22:52:17 +00:00
str4d 4a3350bc31
Merge pull request #189 from str4d/ff-std-ops
Move Field operations to operator-backed traits
2019-12-12 22:32:32 +00:00
Jack Grigg 27c8f34601
Move Field operations to operator-backed traits
The ff_derive, pairing, zcash_primitives::jubjub, and bellman dummy_engine
changes are minimally implemented on top of the existing *_assign()
functions.
2019-12-12 21:19:46 +00:00
str4d 2f7dd6094c
Merge pull request #188 from ebfull/bls12_381_and_jubjub
New BLS12-381 and Jubjub implementations
2019-12-12 19:56:31 +00:00
Sean Bowe 6eddfb11ba
Update Travis CI configuration for Rust version 2019-12-12 11:49:53 -07:00
Sean Bowe 96f602e452
cargo fmt 2019-12-12 11:46:05 -07:00
Sean Bowe a4f7c4eef3
Include jubjub and bls12_381 crates in the workspace. 2019-12-12 11:40:48 -07:00
Sean Bowe 281cfe1912 Merge commit 'd029ddea8396d7a39910028dd5ae436a3bd3e9bb' as 'jubjub' 2019-12-12 11:32:47 -07:00
Sean Bowe d029ddea83 Squashed 'jubjub/' content from commit 9987ddf
git-subtree-dir: jubjub
git-subtree-split: 9987ddf8d17a87bd2b14627665768e4038b657c4
2019-12-12 11:32:47 -07:00
Sean Bowe f5217b56d7 Merge commit 'dbd9bd1b9b43038e60bda8f14576580e51924ea0' as 'bls12_381' 2019-12-12 11:32:35 -07:00
Sean Bowe dbd9bd1b9b Squashed 'bls12_381/' content from commit a9c2c4e
git-subtree-dir: bls12_381
git-subtree-split: a9c2c4e27b36c94b91aa37ddbad0e9ff4b2c5dc6
2019-12-12 11:32:35 -07:00
Sean Bowe 01ab2bd3df
Start relying on Rust 1.39.0 2019-12-12 11:31:00 -07:00
str4d 18aceea225
Merge pull request #50 from zancas/mv_tests_extract_data
Mv tests extract data
2019-12-12 17:46:38 +00:00
zancas 0aa127d7b1
refactor to manage test code and data in separate modules 2019-12-11 23:58:13 +00:00
str4d 8626cc7f26
Merge pull request #186 from str4d/multicore-feature-flag
Pass bellman's multicore feature flag through to zcash_proofs
2019-12-11 20:04:45 +00:00
Jack Grigg eed7e8199f
Pass bellman's multicore feature flag through to zcash_proofs
This enables someone using zcash_proofs to disable multicore.
2019-12-11 18:46:47 +00:00
str4d c3f9e2d73c
Merge pull request #180 from str4d/mmr-cleanups
MMR API cleanups
2019-12-05 16:35:28 +00:00
Jack Grigg cca1670248
Clarify length of return buffer for appended leaves 2019-12-05 14:33:03 +00:00
Jack Grigg f1619f896c
Clearer variable names in MMR tests 2019-12-05 14:29:08 +00:00
Jack Grigg edcd884fe8
Simplify short array copies 2019-12-05 14:24:31 +00:00
Jack Grigg 583a04b4de
Pass array references correctly in MMR tests 2019-12-05 14:23:59 +00:00