Commit Graph

2092 Commits

Author SHA1 Message Date
Jack Grigg 9e63eeff1b Enable `getrandom/js` feature flag for wasm32-unknown-unknown
Our dev-dependencies include getrandom, and the wasm32-unknown-unknown
target requires this getrandom feature flag in order to compile.
2022-01-20 17:42:15 +00:00
Jack Grigg 66a6537613 Pin bumpalo to `>=3,<3.9.0` for wasm32 targets
`bumpalo 3.9.0` raised its MSRV to 1.54; our current MSRV is 1.51.
2022-01-20 17:42:15 +00:00
Jack Grigg f5a8c9dff9 Depend on `rand_core` instead of `rand`
All non-test code no longer depends on `OsRng`, instead requiring the
caller to provide it.
2022-01-20 16:27:35 +00:00
Las Safin 1613445cdb
Fix compilation with rustc 1.57.0
The type inference algorithm seems to have been simplified,
meaning that the combination of T::from(x.into()) doesn't work anymore.

In any case, the code was also incomprehensible to a human, as it's not clear
by which "route" it does the transformation. It took me a few minutes to
figure out it's a `u64`.
2022-01-20 16:24:33 +00:00
str4d eb74bf6ccb
Merge pull request #447 from zcash/poly-ast-evaluator
Add `poly::Evaluator` for building polynomial operation ASTs
2022-01-20 01:42:57 +00:00
Jack Grigg 2102824599 Remove unused `Polynomial` operations with internal parallelism
These have been replaced by operations on either `poly::Ast` nodes, or
operations directly on chunks of polynomials within a higher-level
parallelism context.

Addition and scalar multiplication are (currently) still used in various
areas of the prover, so those are left in place.
2022-01-20 01:35:24 +00:00
Jack Grigg b3b783e0f4 Switch `poly::Ast` from `Box` to `Arc`
This saves a bunch of `Clone`s and `Drop`s, which were consuming
significant amounts of time in large circuits (Orchard), which meant we
didn't save as much time as we could :)
2022-01-19 21:00:18 +00:00
therealyingtong a5cfd2cfc6 circuit::gadget: Remove Orchard-specific names from gadget consts.
- L_ORCHARD_BASE -> pallas::Base::NUM_BITS,
- L_ORCHARD_SCALAR -> pallas::Scalar::NUM_BITS,
- L_VALUE -> L_SCALAR_SHORT,
- MERKLE_DEPTH_ORCHARD -> MERKLE_DEPTH.
2022-01-19 00:47:01 +08:00
therealyingtong 1a3cbeb896 Refactor src/constants and primitives::sinsemilla::constants. 2022-01-19 00:46:12 +08:00
therealyingtong d37db53e0b Implement utility functions inside `gadgets` module.
Instead of importing utility functions from the `orchard` crate,
the `gadgets` module now implements its own:

- lebs2ip
- i2lebsp
- decompose_word
2022-01-19 00:45:18 +08:00
therealyingtong 06ad0b6925 ecc: Introduce FixedPoints trait with Full, Base, Short associated types. 2022-01-19 00:43:52 +08:00
therealyingtong 5f8716d66a gadget::sinsemilla: Move Orchard-specific inputs into src/circuit.
The sinsemilla submodules note_commit and commit_ivk are tailored
for input lengths specific to Orchard. They have been moved out of
the gadget folder and into the circuit folder.

This also involves changing the visibility of some getter functions
to be usable outside gadget::sinsemilla.
2022-01-19 00:43:52 +08:00
str4d 3e0449ed35
Merge pull request #271 from zcash/tests-pasta-prep
Migrate tests from `FieldExt::rand` to `Field::random`
2022-01-18 14:48:07 +00:00
Jack Grigg a83a0b3fd0 Migrate tests from `FieldExt::rand` to `Field::random`
These were missed in zcash/orchard#254.
2022-01-18 14:30:55 +00:00
Jack Grigg 556bb66a47 Parallelize `poly::Evaluator`
We now traverse `poly::Ast` `num_chunks + 1` times: once to collect the
polynomial rotations we need, and then once per chunk.
2022-01-17 14:01:44 +00:00
Jack Grigg 3c757dc593 Migrate `vanishing::Argument` to `poly::Evaluator` 2022-01-17 14:01:44 +00:00
Jack Grigg b7ea224389 Migrate `lookup::Argument::commit_permuted` to `poly::Evaluator` 2022-01-17 13:51:34 +00:00
Jack Grigg 77af83697c Add `poly::Evaluator` for building polynomial operation ASTs
Co-authored-by: Sean Bowe <sean@electriccoin.co>
2022-01-17 13:51:27 +00:00
Kobi Gurkan 617416b6f0 fix(ci): wasm CI now uses the correct targets 2022-01-08 17:10:01 +02:00
str4d dabf364b86
Merge pull request #268 from zcash/update-mockprover-errors
Update `halo2` revision
2022-01-05 14:15:42 +00:00
therealyingtong 1b4dfe4f81 Update Changelog. 2022-01-05 22:14:08 +08:00
therealyingtong d4d167c216 Use MockProver::FailureLocation in gadget unit tests.
This was introduced in halo2#433.
2022-01-05 21:30:45 +08:00
therealyingtong 5b26c7d67a Pass rng to create_proof API.
As of halo2#444, all APIs now take `R: RngCore` arguments instead of
internally depending on `rand::rngs::OsRng`.
2022-01-05 21:30:45 +08:00
therealyingtong f28edd886c Remove .into() from arguments to enable_equality().
As of halo2#416, this is handled internally by the function.
2022-01-05 21:30:45 +08:00
therealyingtong a5ffc3bb47 Update halo2 revision. 2022-01-05 21:30:45 +08:00
str4d 5742eb5c52
Merge pull request #269 from zcash/pin-dependencies
Pin `pprof = 0.6.1`.
2022-01-05 12:27:32 +00:00
therealyingtong 1c11a424e5 Pin pprof to 0.6.1. 2022-01-05 19:44:52 +08:00
str4d 6630a143c1
Merge pull request #450 from zcash/update-deps
Migrate to pasta_curves 0.3 and blake2b_simd 1
2022-01-05 08:03:53 +00:00
Jack Grigg deabd62eee Migrate to pasta_curves 0.3 and blake2b_simd 1 2022-01-05 02:45:51 +00:00
str4d f9b3ff2aef
Merge pull request #433 from zcash/mockprover-failure-locations
dev: Enable `VerifyFailure::ConstraintNotSatisfied` to point to region offsets
2022-01-04 14:06:28 +00:00
str4d f565883db0
Merge pull request #448 from zcash/dev-fill-from-row
[dev] Implement `Assignment::fill_from_row()` for `MockProver`.
2022-01-04 13:12:55 +00:00
therealyingtong fe75ceee28 dev::bad_lookup test: Fix lookup expression. 2022-01-04 14:23:08 +08:00
therealyingtong 7f526f01e6 dev: Implement fill_from_row() for MockProver. 2022-01-04 14:23:08 +08:00
therealyingtong 3d22943ebe dev::bad_lookup test: Do not assign zero in lookup table.
We now expect the lookup to fail when q = 0, but it still passes,
revealing a bug in the MockProver.
2022-01-04 14:23:08 +08:00
str4d d062072366
Merge pull request #424 from zcash/fix-assigned
Fix `Assigned<F>` implementation
2022-01-03 22:09:51 +00:00
str4d 6ffe61fd81
Add some extra `Assigned<F>` test cases
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-03 17:00:47 +00:00
str4d b5adc3843d
Fix comments in `Assigned<F>` tests
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-03 16:50:29 +00:00
str4d d57c530d99
Merge pull request #444 from zcash/more-pasta-prep
More preparations for `pasta_curves 0.3`
2022-01-03 13:26:51 +00:00
str4d 408b617376
Merge pull request #397 from rex4539/typos
Fix typos
2021-12-31 14:14:34 +00:00
Daira Hopwood 5614b076b9
Merge pull request #446 from HAOYUatHZ/patch-1
fix typos
2021-12-29 19:54:38 +00:00
HAOYUatHZ 5a65c7b77b
fix typos 2021-12-29 15:00:32 +08:00
ying tong 3cd7a141cc
Merge pull request #442 from zcash/therealyingtong-patch-1
[book] Fix SHA256 interpolation polynomial
2021-12-29 09:22:37 +08:00
Jack Grigg 1556489a9f Remove usage of `FieldExt::rand`
All APIs now take `R: RngCore` arguments instead of internally depending
on `rand::rngs::OsRng`.
2021-12-25 13:41:39 +00:00
Jack Grigg 9297a938ab Remove `FieldExt::from_u64` usage from SHA-256 example 2021-12-25 13:34:36 +00:00
ying tong 2ab6e1b0d6
[book] Fix SHA256 interpolation polynomial
Closes #434
2021-12-23 22:07:09 +08:00
str4d af8e0d619a
Merge pull request #432 from zcash/381-rename-verifyfailure-cell
Rename `VerifyFailure::Cell` to `VerifyFailure::CellNotAssigned`
2021-12-21 15:33:08 +00:00
Jack Grigg 558e03aa93 dev: Enable `VerifyFailure::ConstraintNotSatisfied` to point to region offsets 2021-12-21 03:00:16 +00:00
Jack Grigg 5520d13480 dev: Move reusable logic onto `FailureLocation` 2021-12-21 02:56:39 +00:00
Jack Grigg 54125fbc8c dev: Rename `LookupFailure` to `FailureLocation` 2021-12-21 02:56:39 +00:00
str4d 3f53d9f6bd
Merge pull request #431 from zcash/mockprover-improve-lookup-error
Improve `dev::VerifyFailure::Lookup` information
2021-12-20 22:39:33 +00:00