Commit Graph

2403 Commits

Author SHA1 Message Date
str4d f6efecc596
Merge pull request #603 from zcash/batch-verifier-return-rng
Add `BatchVerifier::finalize_and_return_rng`
2022-06-22 17:43:50 +01:00
Jack Grigg 22ec36979c Add `BatchVerifier::finalize_and_return_rng` 2022-06-21 15:04:08 +00:00
Han f586922d19
Merge pull request #81 from han0110/fix/evaluation
Negate the subtrahend when processing `Expression::Sum`
2022-06-21 16:05:16 +02:00
han0110 3966f4efff fix: negate the subtrahend when processing `Expression::Sum` in `Evaluator::add_expression` 2022-06-21 15:02:28 +08:00
str4d c9fc4c6720
Merge pull request #601 from zcash/book/update-comparison
[book] Add `U` to `BCMS` comparison table
2022-06-21 03:17:58 +01:00
ying tong 69a980ff40
[book] Add `U` to `BCMS` comparison table 2022-06-15 10:40:49 -04:00
str4d a898d65ae3
Merge pull request #598 from zcash/circuit-value-type
Introduce `halo2_proofs::circuit::Value`
2022-06-13 16:41:26 +01:00
str4d 7cb71b4814
Update halo2_proofs/src/circuit/value.rs
Co-authored-by: ying tong <yingtong@z.cash>
2022-06-13 16:41:05 +01:00
str4d 1cf376e9a6
Merge pull request #597 from zcash/small-perf-improvements
Small performance improvements
2022-06-10 00:48:23 +01:00
Jack Grigg 5752adf0e5 halo2_proofs: `impl {Add, Sub, Mul} for &Value<V>` 2022-06-09 22:44:25 +00:00
Jack Grigg 521d6edd1c halo2_proofs: Make `Value::{known, unknown}` const 2022-06-09 22:40:11 +00:00
Jack Grigg 5ed3d2501f halo2_gadgets: Replace `Option<V>` with `Value<V>` 2022-06-08 23:31:25 +00:00
Jack Grigg 47f25ad632 halo2_proofs: Replace `Option<V>` with `Value<V>` 2022-06-08 23:03:16 +00:00
Jack Grigg c17d52e5bf halo2_proofs: Add `halo2_proofs::circuit::Value<V>`
This is a more usable and type-safe replacement for `Option<V>` in
circuit synthesis.
2022-06-08 22:29:14 +00:00
Jack Grigg 515f97769f halo2_gadgets: Enable more inversions to be batched during synthesis 2022-06-08 00:50:16 +00:00
Jack Grigg 5f1fb166d1 halo2_gadgets: Reduce allocations during var-mul synthesis 2022-06-08 00:50:16 +00:00
Chih Cheng Liang 1fc67702da
Merge pull request #75 from ChihChengLiang/license-of-the-fork
Licenses of the fork
2022-06-03 10:34:24 +02:00
ChihChengLiang bb8070ecb3 add downstream licenses 2022-06-01 14:38:21 +02:00
ChihChengLiang a6aea6d88c add upstream licenses 2022-06-01 14:35:59 +02:00
ChihChengLiang c26a17cac7 rm ECC license 2022-06-01 14:29:06 +02:00
str4d c0db68aa05
Merge pull request #589 from zcash/protocol-rule-links
halo2_gadgets: Add protocol rule links for the chip constraints
2022-05-27 16:46:56 +01:00
Jack Grigg c1007d8c23 halo2_gadgets: Add protocol rule links for the chip constraints
Part of zcash/zcash#3957.
2022-05-25 22:41:04 +00:00
ying tong 34b2e77a57
Merge pull request #467 from zcash/sha256-tweaks
SHA-256 chip tweaks
2022-05-25 12:51:16 +08:00
str4d 8075b216e8
Merge pull request #584 from trel/remove_dsstore
remove .DS_Store
2022-05-13 15:29:23 +01:00
Terrell Russell 076fa24390 remove .DS_Store 2022-05-13 09:18:59 -04:00
str4d bf459804f6
Merge pull request #581 from zcash/release-0.1.0
Release `halo2_proofs` and `halo2_gadgets` 0.1.0
2022-05-10 23:27:30 +01:00
Jack Grigg e36041d198 halo2_gadgets 0.1.0
Closes zcash/halo2#460.
2022-05-10 22:05:30 +00:00
Jack Grigg 3bc0c598ef halo2_proofs 0.1.0
Closes zcash/halo2#426.
2022-05-10 22:01:21 +00:00
str4d 50921f95f7
Merge pull request #573 from zcash/str4d/chip-review
Changes from `halo2_gadgets` review
2022-05-10 22:54:45 +01:00
Jack Grigg 91e1106a1e halo2_gadgets: Address review comments 2022-05-10 21:35:52 +00:00
Jack Grigg 4b802a7d07 halo2_gadgets: Documentation fixes 2022-05-10 20:31:35 +00:00
Jack Grigg ac67b117ca book: Document `EccChip` assumptions and general layout 2022-05-10 20:26:30 +00:00
Jack Grigg a94a2bc552 halo2_gadgets: Various small code cleanups
Also documents a superfluous constraint, for removal in some future
breaking change.
2022-05-10 20:26:30 +00:00
Jack Grigg ad51e4a2bd book: Document var-mul constraints for complete addition and LSB 2022-05-10 20:26:30 +00:00
Jack Grigg f57b93f8e0 book: Fix various small bugs and add some missing constraints 2022-05-10 20:26:30 +00:00
Jack Grigg ff01e4a1f9 halo2_gadgets: Refactor `ScalarFixed::windows_usize`
It no longer relies on the `SqrtRatio::get_lower_32` method, which is
specific to that trait and not intended for external usage.
2022-05-10 20:26:30 +00:00
Jack Grigg 692fee099d halo2_gadgets: Clean up `ecc::chip::mul_fixed::Config` logic
- We were redundantly storing the `x_p` and `y_p` columns.
- `Config::add_incomplete` was redundantly copying.

Co-authored-by: therealyingtong <yingtong@z.cash>
2022-05-10 20:04:30 +00:00
Jack Grigg 85b0b7c065 halo2_gadgets: Refactor `ecc::chip::mul_fixed::Config` word assignment logic
Co-authored-by: therealyingtong <yingtong@z.cash>
2022-05-10 20:04:30 +00:00
Jack Grigg 18edad5df6 halo2_gadgets: Use separate field names for var-mul incomplete selectors
The previous tuple was confusing because tuple indices are zero-indexed,
while the selector names are one-indexed.
2022-05-10 20:04:30 +00:00
Jack Grigg 56fc8960c6 halo2_gadgets: Extract a common `DoubleAndAdd` helper struct
Both variable-base scalar mul and Sinsemilla use double-and-add with
incomplete addition on a single row, but they do so in slightly
different ways. Some of these are intentional (needing to look up the
y-coordinate vs constrain it), while others are accidental (different
concrete signs in otherwise-identical constraints that make their ASTs
incompatible).

The new `DoubleAndAdd` helper struct extracts the logic that is common
to both implementations, specifically the helper definitions of `x_r`
and `Y_A`. In a future breaking change, we can refactor both gadgets to
share more of this logic, so we are defining the incomplete addition
logic in fewer places.
2022-05-10 20:04:30 +00:00
Daira Hopwood bdf84a5bb5
Merge pull request #580 from zcash/book-patch-summary
[book] Add 'Selector combining' to SUMMARY.md
2022-05-10 05:21:29 -07:00
therealyingtong e4e7821fc1 [book] Add 'Selector combining' to SUMMARY.md 2022-05-10 15:38:10 +08:00
Jack Grigg 88e189eebb book: Add page for witnessing ECC points 2022-05-10 00:20:00 +00:00
Jack Grigg 17cd222979 book: Add explicit constraints table for incomplete addition 2022-05-10 00:20:00 +00:00
Jack Grigg 144d082528 halo2_gadgets: Refactor complete addition constraints
We also fix several typos in the constraint analysis on the complete
addition book page, and adjust the constraints table for readability.
2022-05-10 00:20:00 +00:00
Jack Grigg 342ebdd15e halo2_gadgets: Fix return type of `ecc::chip::FixedPoint::u`
This trait method was previously preventing the trait to working with
fields that encode to more than 256 bits.
2022-05-10 00:20:00 +00:00
Brecht Devos bffb83e4d1
Use a hash map to track cell assignment (#71) 2022-05-09 18:47:54 +02:00
Jack Grigg 3486703bd2 halo2_gadgets: Refactor fixed-base scalar mul gadget APIs
The new `EccInstructions` instructions, and the corresponding changes to
existing instructions, enable chips to choose when to witness or constrain
the scalars, and simplify scalar reuse (though reuse is not implemented
for `EccChip` yet).

`FixedPoint::mul` and `FixedPointShort::mul` now has the same API style
as `NonIdentityPoint::mul`.
2022-05-09 15:48:55 +00:00
Jack Grigg 6145b1417c halo2_gadgets: Move `primitives::*` to `*::primitives` 2022-05-09 05:43:34 +00:00
Jack Grigg 96d4a31d39 halo2_gadgets: Batch inversions in `SinsemillaChip::hash_to_point`
This saves around 3.7% in proving time for a 2-action Orchard bundle on
a Ryzen 9 5950X.
2022-05-08 03:28:34 +00:00