Commit Graph

1055 Commits

Author SHA1 Message Date
str4d 702b5e5d8c
Merge pull request #193 from str4d/group-std-ops
Move Group operations to operator-backed traits
2020-01-28 17:41:50 +00:00
str4d 53ef825468
Merge pull request #197 from str4d/clippy-cleanups
Clippy cleanups
2020-01-16 13:08:32 -05:00
Jack Grigg 21efaccc9f librustzcash: Use "if let" syntax 2020-01-14 22:33:50 -05:00
Jack Grigg 620213a0f0 ff_derive: Fix a clippy issue in generated code
This shows up as a clippy warning in the pairing crate.
2020-01-14 22:00:50 -05:00
Jack Grigg 3c84625438 pairing: Allow clippy::cognitive_complexity in test_frob_coeffs 2020-01-14 22:00:17 -05:00
Jack Grigg 2f38316359 pairing: Fix various clippy issues 2020-01-14 22:00:17 -05:00
Jack Grigg 61f052a68f ff: Use readable literals 2020-01-14 22:00:17 -05:00
Jack Grigg 00a4e1388b ff: Make byteorder an optional dependency under the std feature flag
Building ff with the std feature flag was previously broken because it
required importing byteorder functionality behind the byteorder/std
feature flag. We don't use byteorder inside ff in no_std mode, so we can
just make it optional.
2020-01-14 22:00:16 -05:00
Jack Grigg 8887414c49 ff_derive: Fix various clippy issues 2020-01-14 21:59:45 -05:00
Jack Grigg 2bfc715828 bls12_381: Remove unnecessary clones
The structs in question all implement Copy.
2020-01-14 21:08:34 -05:00
Jack Grigg 911d248b86 bls12_381: Remove unnecessary unit return values 2020-01-14 21:06:10 -05:00
Jack Grigg f99ab768dc bls12_381: Remove unnecessary references 2020-01-14 21:03:39 -05:00
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