Commit Graph

2396 Commits

Author SHA1 Message Date
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
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
Jack Grigg 03697e2a7d book: Rewrite Sinsemilla gadget page
The book now has enough detail for it to be obvious why there are
factors of 2 present in several equations.
2022-05-08 02:38:01 +00:00
Jack Grigg dc2ec0308d halo2_gadgets: Deduplicate some Sinsemilla chip expressions 2022-05-08 02:38:01 +00:00
Jack Grigg 6444ccc16f halo2_gadgets: Tidy up and document MerkleCRH implementation 2022-05-08 02:38:01 +00:00
Jack Grigg 7ea240dbdf book: Rewrite `MerkleCRH` gadget page
The page now follows the pattern of other chip-specifying pages in how
it documents constraints (in particular, giving the specific form of the
constraint to match the implemented AST).

Additionally, a typo in the decomposition constraint for `left` has been
fixed (the implementation was correct).
2022-05-08 02:20:42 +00:00
Jack Grigg 3bed5725e5 Use `MessagePiece::from_subpieces` in `MerkleChip::hash_layer`
Several structs now impl `PartialEq, Eq` due to requirements of the
`MessagePiece::from_subpieces` impl.
2022-05-08 02:20:42 +00:00
Jack Grigg 0d978f0fc4 halo2_gadgets: Generalise `MerklePath` beyond two `MerkleChip`s 2022-05-07 23:03:30 +00:00
str4d 30f92f3f4b
Merge pull request #522 from zcash/full-width-var-base-mul
[ECC gadget] Distinguish base field element case in variable-base scalar mul.
2022-05-06 19:53:57 +01:00
str4d 5a543f9318
Move `EccInstructions::ScalarVar` changelog entry to "Changed" 2022-05-06 19:06:06 +01:00
therealyingtong 3c6ffb66cf Address comments from code review.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2022-05-06 23:28:20 +08:00
Kris Nuttycombe 6e762bdde4
Merge pull request #380 from 3for/main
[book] Fix errors and typos
2022-05-05 20:42:23 -06:00
Kris Nuttycombe 1791e693bb
Merge branch 'main' into main 2022-05-05 17:07:57 -06:00
ebfull 6fb622a1fc
Merge pull request #543 from NoCtrlZ/feat/fft-optimization
Optimize Fft
2022-05-05 14:05:13 -06:00
ebfull a1d1371ce3
Merge pull request #563 from parazyd/clone-impls-keys
plonk: Derive Clone for VerifyingKey and ProvingKey.
2022-05-05 13:59:44 -06:00
Taylor Hornby 64e7efb0d4
Merge pull request #542 from zcash/relicense-mit-or-apache-2.0
Relicense Halo 2 crates as MIT OR Apache 2.0
2022-05-05 13:50:45 -06:00
therealyingtong fdf516908b Update changelog. 2022-05-05 21:34:30 +02:00
therealyingtong 5fd0834503 Introduce ScalarVar::new and ScalarVar::from_base gadget APIs. 2022-05-05 21:33:43 +02:00
therealyingtong 1c877f3caf ecc::chip: Introduce ScalarVar enum. 2022-05-05 21:14:21 +02:00
therealyingtong 6f2fc57b3c Rename FixedPoint::ScalarKind -> FixedPoint::FixedScalarKind. 2022-05-05 21:14:21 +02:00
therealyingtong 5ebfe91eee Introduce ecc::BaseFitsInScalarInstructions trait. 2022-05-05 21:14:20 +02:00
therealyingtong cbf3d6a7f6 EccInstructions: introduce witness_scalar_var() instruction. 2022-05-05 21:14:20 +02:00
therealyingtong 6d83db719e EccInstructions::mul: take Self::ScalarVar instead of Chip::Var. 2022-05-05 21:14:20 +02:00
str4d 72ff677776
Merge pull request #511 from zcash/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-05-05 16:08:26 +01:00
str4d 377de3998c
Merge pull request #554 from zcash/dependabot/github_actions/codecov/codecov-action-3.1.0
Bump codecov/codecov-action from 2.1.0 to 3.1.0
2022-05-05 16:07:57 +01:00
str4d b2e2b9b081
Merge pull request #568 from zcash/circuit-review
Changes from Orchard circuit review
2022-05-05 16:03:31 +01:00
str4d 506e310d37
Merge pull request #570 from zcash/ff-0.12
Migrate to `ff 0.12`
2022-05-05 01:06:48 +01:00
Jack Grigg 3800de5918 Rename `RangeConstrained::subset_of` to `bitrange_of` 2022-05-04 23:52:15 +00:00
Jack Grigg e04c8bfb4b Migrate to `ff 0.12` 2022-05-04 23:36:18 +00:00
Jack Grigg 97864d714e halo2_gadgets: Add `MessagePiece::from_subpieces`
We introduce a new `RangeConstrained` newtype wrapper for tracking the
number of bits to which some type has been constrained.
2022-05-02 16:04:02 +00:00
str4d 1ccef3b30a
Merge pull request #566 from zcash/ci-2-fix-2-bench
halo2: Disable default benchmark harness
2022-05-01 16:25:44 +01:00
Jack Grigg f0168cf7dc halo2: Disable default benchmark harness
See 55364f0d99 for why this is necessary.
2022-04-29 00:48:44 +00:00
dependabot[bot] 1d9ca93948
Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-29 00:26:50 +00:00
str4d c73695188b
Merge pull request #565 from zcash/ci-fix-bench
CI: Fix Rust version used for benchmarks
2022-04-29 01:26:09 +01:00
Jack Grigg 6ff065c58c CI: Fix Rust version used for benchmarks 2022-04-29 00:20:58 +00:00
NoCtrlZ 32ed927579 Apply @daira's review suggestion 2022-04-28 09:47:22 +09:00
NoCtrlZ 9a9873a2c5 optimize fft 2022-04-28 09:44:54 +09:00
Jack Grigg 7d15fa3db5 sha256: Simplify single-constraint gates
`Option<T>` implements `IntoIterator<Item = T>`, so we don't need to
wrap it in an explicit iterator.
2022-04-27 20:12:03 +00:00
Jack Grigg f2d1f1d56a sha256: Add `InitialRound` and `MainRoundIdx` structs
This enables the runtime `assert!(matches!(..))` on `RoundIdx` to be
replaced by type system checks.
2022-04-27 20:12:03 +00:00
ebfull 0c33fa4e6e
Merge pull request #564 from zcash/482-msrv-1.56.1
Set MSRV to 1.56.1
2022-04-27 13:05:12 -06:00
Jack Grigg aa4639e6e7 Temporarily revert `resolver = "2"`
This breaks WASM bitrot checks, because it causes the regular
dependencies to be built without the `getrandom/js` flag that we
currently only enable for dev-dependencies. We can revert this once we
have a more reliable way to test WASM compatibility.
2022-04-27 16:53:38 +00:00
Jack Grigg fdc6c9df19 halo2_gadgets: pprof 0.8 2022-04-27 12:58:16 +00:00
Jack Grigg f4675997bc Fix some clippy lints 2022-04-27 12:58:16 +00:00
Jack Grigg e3f1bf68db halo2_gadgets: Remove usage of `array::IntoIter::new`
Rust 2021 implements `IntoIterator` for arrays directly, instead of only
references to arrays.

    https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html
2022-04-27 12:56:54 +00:00