Commit Graph

19 Commits

Author SHA1 Message Date
Daira Hopwood 6b6b515232 `hash_to_point` should return `Result<(Self::NonIdentityPoint, Vec<Self::RunningSum>), Error>`
because any exceptional case is treated as an error, and therefore the identity cannot be returned.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 13:13:25 -06:00
therealyingtong 283b45169a merkle: Replace l_plus_1 with l
Since l_plus_1 is no longer used as a selector, we can directly
use the value l in the gate.
2021-07-25 21:10:13 +08:00
therealyingtong 29f185014f merkle: Replace l_plus_1 fixed column with q_decompose selector.
Previously, l_plus_1 was a non-binary fixed column, used to
1. provide the value of l + 1; and
2. toggle the decomposition gate.

Now, the value is copied in from the global constants column, and
the toggle is handled by a binary q_decompose selector.
2021-07-25 21:10:13 +08:00
Jack Grigg bf72e308bd De-duplicate LookupRangeCheckConfig
We were configuring multiple instances of this across all of the advice
columns, in order to spread their assignments. However, we are actually
more constrained by columns than rows, and we have comparatively few
rows of range check logic required for the Action circuit.

We now use a single LookupRangeCheckConfig for the entire circuit. The
reduction in lookup arguments and fixed columns cuts the proof size in
half (now at 6048 bytes when using `floor_planner::V1`).

Co-authored-by: therealyingtong <yingtong@z.cash>
2021-07-21 16:03:54 +01:00
therealyingtong 4ba8762dcd Circuit::synthesize(): Merkle path validity. 2021-07-21 20:35:43 +08:00
therealyingtong 8402c9d479 gadget::sinsemilla.rs: Make running sum available at gadget level.
The interstitial values of the Sinsemilla running sum are used in
checking canonicity of the field elements input to the hash.
2021-07-21 20:35:43 +08:00
str4d bd28b46163
Merge pull request #150 from zcash/bump-halo2-again
Migrate to latest `halo2` API
2021-07-19 13:56:59 +01:00
str4d 38f9e3076f
Update code comments after review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: ying tong <yingtong@z.cash>
2021-07-19 13:56:18 +01:00
therealyingtong df4bf422f5 gadget::sinsemilla.rs: Add CommitDomain
SinsemillaInstructions gains several associated types specific to
SinsemillaCommit.
2021-07-19 20:03:12 +08:00
Jack Grigg 15f9d254d9 Migrate to latest `halo2` API
- `halo2::plonk::{create_proof, verify_proof}` now take instance columns
  as slices of values.
- `halo2::plonk::Permutation` has been replaced by a global permutation,
  to which columns can be added with `ConstraintSystem::enable_equality`.
- The introduction of blinding rows means that various tests now require
  larger circuit parameters.
2021-07-19 12:53:38 +01:00
Jack Grigg 7c38f149ac rustfmt 2021-06-29 22:46:07 +01:00
str4d 8dfcd7d49b
Remove unused lookup_config in MerkleConfig 2021-06-29 22:41:01 +01:00
therealyingtong 3806a9d6f0 Further cleanups and docfixes.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-06-29 12:08:31 +08:00
therealyingtong d68eb6583d Docfixes, variable renames, cleanups
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-06-29 12:08:31 +08:00
therealyingtong 32e564a963 Constrain b_1 + 2^5 b_2 = z1_b in decomposition gate. 2021-06-29 12:08:31 +08:00
therealyingtong f30de79fc6 sinsemilla::merkle.rs: Implement MerkleInstructions for MerkleChip.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-06-29 12:08:31 +08:00
therealyingtong 569eb4baa6 sinsemilla::merkle.rs: Configure MerkleChip
MerkleChip::configure() takes a SinsemillaConfig as input.
2021-06-29 12:08:31 +08:00
therealyingtong 6976e2baeb sinsemilla::merkle.rs: Derive SinsemillaInstructions, CondSwapInstructions for MerkleChip 2021-06-29 12:08:31 +08:00
therealyingtong 68878d88b1 sinsemilla::merkle.rs: Add MerkleChip 2021-06-29 12:08:31 +08:00