Commit Graph

2073 Commits

Author SHA1 Message Date
Deirdre Connolly 7412dfe79a
Update src/circuit.rs
Co-authored-by: str4d <thestr4d@gmail.com>
2021-11-04 17:54:30 -04:00
str4d 9dd1bffa76
Merge pull request #395 from zcash/dependabot-actions
CI: Add Dependabot config to keep Actions up-to-date
2021-11-05 07:00:55 +13:00
Jack Grigg 0c1c5be67f CI: Add Dependabot config to keep Actions up-to-date 2021-11-04 16:42:47 +00:00
Jack Grigg 9c226d33b9 dev: Collect values of queried cells for unsatisfied constraints
Co-authored-by: ying tong <yingtong@z.cash>

Closes zcash/halo2#364.
2021-11-04 14:03:47 +00:00
Jack Grigg 26622ce5b0 `impl Ord for plonk::Any` 2021-11-04 14:03:16 +00:00
Deirdre Connolly e51e92e848 Add `orchard::circuit::Instance::from_parts()` 2021-11-03 23:24:54 -04:00
Daira Hopwood ddd34ff972
Merge pull request #389 from zcash/dev-faster-mockprover
dev: Remove O(n^2) loop in lookup checks.
2021-10-26 14:11:55 +01:00
therealyingtong b94aab76a3 dev: Remove O(n^2) loop in lookup checks.
Co-authored-by: Kris Nuttycombe<kris@nutty.land>
2021-10-22 19:33:30 +02:00
ebfull 4f9c0be42e
Merge pull request #187 from zcash/poseidon-fq
primitives::poseidon: Add constants for Fq field modulus.
2021-10-15 08:29:01 -06:00
ying tong 6eca11b37a
Merge pull request #386 from zcash/book-patch-2
[book] Update link `upa.md` -> `plonkish.md`
2021-10-14 12:39:25 +02:00
ying tong 3d2c0e429e
[book] Update link `upa.md` -> `plonkish.md`
Closes #367
2021-10-14 12:38:52 +02:00
therealyingtong c61524ea29 p128pow5t3::tests: Extract verify_constants_helper.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-10-12 11:58:27 +02:00
therealyingtong 2c97e56da7 Add hash() and permute() test vectors for Poseidon over Fq. 2021-10-12 11:58:27 +02:00
therealyingtong f5775b6c6d p128pow5t3.rs: Test against reference input for Fq field modulus. 2021-10-12 11:58:27 +02:00
therealyingtong 4eb4c57827 Impl Spec for P128Pow5T3 over Fq. 2021-10-12 11:58:27 +02:00
therealyingtong 764c445a81 Rename poseidon::nullifier -> poseidon::p128pow5t3. 2021-10-12 11:58:27 +02:00
therealyingtong 8e00f69d63 primitives::poseidon: Add constants for Fq field modulus. 2021-10-12 11:58:27 +02:00
Jack Grigg 5be597c3bc book: Add example for `halo2::dev::circuit_dot_graph` 2021-10-01 16:01:24 +01:00
str4d 658c2db421
Merge pull request #374 from zcash/trait-usage
Clean up our trait usage
2021-10-02 01:54:55 +13:00
Jack Grigg c9d890377c book: Render example for `CircuitLayout` 2021-10-01 13:39:04 +01:00
Jack Grigg e3e68bc5d7 book: Fix bugs in dev tools page 2021-10-01 13:39:04 +01:00
Jack Grigg 7463a6e931 examples: Reorganise circuit-layout example to use in book 2021-10-01 13:39:04 +01:00
Jack Grigg b46ef35db5 clippy: Allow unused imports
We can remove this once `pasta_curves` has been updated to remove
`CurveAffine::read`.
2021-10-01 13:33:47 +01:00
Jack Grigg 3fba7434d1 Use `ff::PrimeField::root_of_unity` instead of `FieldExt::ROOT_OF_UNITY` 2021-09-30 23:06:32 +01:00
Jack Grigg 9dc2738305 Remove usages of `CurveAffine::{read, write}`
A new `CurveRead` helper trait brings in the `CurveAffine::read` impl.
2021-09-30 23:06:32 +01:00
Jack Grigg 17b8fe1baa Use `ff::Field::pow_vartime` instead of `FieldExt::pow` 2021-09-30 22:54:42 +01:00
Jack Grigg a5a3c8ca63 Use `From<u64>` instead of `FieldExt::from_u64` 2021-09-30 22:53:00 +01:00
Jack Grigg 0e6b0344f5 Use `ff::PrimeField::{from_repr, to_repr}` instead of `FieldExt` 2021-09-30 22:53:00 +01:00
Jack Grigg 9693065a00 Use `ff::BatchInvert` now that we have upstreamed it 2021-09-30 22:35:33 +01:00
str4d 2c8241f25b
Merge pull request #209 from zcash/circuit-bugfixes
Circuit bugfixes
2021-09-29 10:06:25 +13:00
Jack Grigg 631182fb77 Update selector columns in expected-failure tests
The addition of the non-identity selector caused the layouter to reorder
some of the selectors in the ECC gadget test circuit.
2021-09-28 21:49:06 +01:00
str4d 41066a310a
Merge pull request #208 from zcash/halo2-beta-1
Switch to halo2 0.1.0-beta.1
2021-09-29 09:12:15 +13:00
Daira Hopwood d77cb82c8d
Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-09-28 21:09:39 +01:00
Jack Grigg d0056d9050 Test that we can't witness the identity as a NonIdentityPoint 2021-09-28 21:00:29 +01:00
Jack Grigg 608da3f686 Switch to halo2 0.1.0-beta.1
This is equivalent to the git revision we were previously patching.
2021-09-28 20:48:19 +01:00
Sean Bowe ebfd919abc Update circuit description. 2021-09-28 20:31:32 +01:00
str4d aec3b1d52d Remove unnecessary clones in closure 2021-09-28 20:31:32 +01:00
therealyingtong 52f53f3425 Remove IsIdentity trait from public EccInstructions.
We only need is_identity() in tests and can implement it on the
concrete EccPoint type. This method is flagged off by #[cfg(test)].

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 20:31:32 +01:00
therealyingtong c80ccba801 Witness cm_old using Point::new().
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 20:31:32 +01:00
therealyingtong b0de6afd7c Reintroduce Point::new() API and constraints.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 20:31:32 +01:00
Jack Grigg 751277cdb2 Remove `EccInstructions::NonIdentityPoint: TryFrom<Self::Point>` bound
After the previous commit, this is no longer used anywhere. Additionally
it was not enforcing the conversion in the circuit, which could lead to
circuit implementation mistakes.
2021-09-28 13:13:25 -06:00
Jack Grigg 97c27e3d5a Use complete addition in SinsemillaCommit
This is necessary because the blinding factor r can be zero with greater
than negligible probability in an adversarial case, which with incomplete
addition would cause the circuit to compute a commitment that is not on
the curve.
2021-09-28 13:13:25 -06:00
therealyingtong 8c8a12a8df Minor fixes.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-09-28 13:13:25 -06:00
therealyingtong fa560d3aee Replace is_identity() instruction with IsIdentity trait. 2021-09-28 13:13:25 -06:00
therealyingtong 4a13ab4f6b Docfixes.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 13:13:25 -06:00
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 8ad3003e27 Remove Point::new() API and introduce is_identity() instruction.
Also remove the q_point selector and gate from the circuit.
2021-09-28 13:13:25 -06:00
therealyingtong ec27989b9b Clippy and formatting fixes.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 13:13:25 -06:00
therealyingtong a5a6e78d42 src/circuit.rs: Use NonIdentityPoint for all witnessed points.
The witnessed points are cm_old, g_d_old, pk_d_old, ak.

g_d_new and pk_d_new are currently also witnessed as affine points,
which diverges from the spec.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 13:13:25 -06:00
therealyingtong cdcfcbc0c2 gadget::sinsemilla: Propagate changes to the Sinsemilla gadget.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-28 13:13:25 -06:00