Jack Grigg
76e0f658c1
Rename CommitmentTreeWitness -> MerklePath
2020-02-08 00:36:40 +00:00
Jack Grigg
3a3008caf9
Pass CommitmentTreeWitness directly into Builder::add_sapling_spend
...
This is more likely to be the data that the caller has available, and
is all we need now that a CommitmentTreeWitness can compute its root.
2020-02-07 17:31:38 +00:00
Jack Grigg
8a210ec271
CommitmentTreeWitness::root(leaf)
2020-02-07 17:21:59 +00:00
Jack Grigg
2064d1c801
Refactor zcash_primitives::merkle_tree::CommitmentTreeWitness
...
- The internal Option wrapper was an unnecessary leftover from when this
code was directly inside the prover, where Some(x) represents an
assigned variable.
- CommitmentTreeWitness::from_slice_with_depth is more idiomatic Rust.
2020-02-07 00:06:57 +00:00
str4d
ee32f7facb
Merge pull request #198 from huitseeker/warts
...
Addressing some trivial Rust option/iterator lints
2020-02-04 18:18:09 +00:00
str4d
903c02b991
Merge pull request #202 from str4d/coverage-build-fix
...
CI: Use stable Rust release for code coverage
2020-02-03 19:05:34 +00:00
Jack Grigg
1f38523fff
CI: Use stable Rust release for code coverage
...
Fixes an issue where cargo-tarpaulin failed to build the crate on
1.37.0, but the crate itself builds fine with that version.
2020-02-03 18:08:56 +00:00
François Garillot
865275e2a2
Correcting some trivial Rust option/iterator warts
2020-01-29 13:53:05 -08:00
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