Commit Graph

2108 Commits

Author SHA1 Message Date
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
str4d 54cdc051fe
Merge pull request #237 from zcash/orchard-mainnet-circuit
Orchard proposed mainnet circuit
2021-12-20 17:49:57 +00:00
str4d 40cc3cb728
Merge pull request #267 from zcash/crate-cleanups
Crate cleanups
2021-12-20 17:35:53 +00:00
Jack Grigg d11fbd4a56 Remove `ValueSum::from_raw`
There is no reason for crate users to be constructing `ValueSum`
directly. We no longer use it to represent `valueBalanceOrchard`,
instead requiring the user to specify their own type.
2021-12-20 16:08:44 +00:00
Jack Grigg 04af08d343 Fix documentation of `orchard::value` module
Closes zcash/orchard#142.
2021-12-20 16:05:33 +00:00
Jack Grigg d84764f2db Remove outdated doc comment on `MerkleHashOrchard`
Closes zcash/orchard#245.
2021-12-20 15:24:48 +00:00
Jack Grigg 0e1220acc9 Merge branch 'main' into orchard-mainnet-circuit 2021-12-20 15:20:33 +00:00
Jack Grigg 28489d03ad Rename `VerifyFailure::Cell` to `VerifyFailure::CellNotAssigned`
Closes zcash/halo2#381.
2021-12-20 14:45:56 +00:00
Jack Grigg cbe4d05002 dev: Match lookup failures to regions
This currently matches the first region on the row that matches any
input column, which will result in some mismatches. To fix this, we will
need to track the columns of complex selectors.
2021-12-20 13:16:55 +00:00
Jack Grigg 3843c11e82 dev: Enable `VerifyFailure::Lookup` to point to region offsets 2021-12-20 13:16:55 +00:00
str4d a061a861b3
Merge pull request #266 from zcash/release-0.1.0-beta.1
Release 0.1.0-beta.1
2021-12-17 22:30:14 +00:00
Jack Grigg f98431175a orchard 0.1.0-beta.1 2021-12-17 22:10:35 +00:00
Jack Grigg 369b99ee3f Add `doc_cfg` annotations 2021-12-17 22:08:58 +00:00
Jack Grigg bb04300059 zcash_note_encryption 0.1 2021-12-17 22:08:23 +00:00
Jack Grigg af236a34ad blake2b_simd 1 2021-12-17 17:06:37 +00:00
Jack Grigg f468e604e3 pprof 0.6 2021-12-17 17:05:23 +00:00
Jack Grigg 4af28cb6d4 incrementalmerkletree 0.2 2021-12-17 16:39:48 +00:00
str4d cad50e7611
Merge pull request #265 from zcash/zcash_note_encryption-api-cleanups
Migrate to latest `zcash_note_encryption` API
2021-12-17 13:43:07 +00:00
Jack Grigg 4b0b32275f Migrate to latest `zcash_note_encryption` API 2021-12-17 05:31:24 +00:00
ebfull 4592c2f275
Merge pull request #262 from zcash/261-ak_P-reject-identity
Reject the identity in `SpendValidatingKey::from_bytes`
2021-12-16 08:19:58 -07:00
str4d b13b9677cf
Merge pull request #254 from zcash/pasta_curves-prep
Remove various usages of `FieldExt` methods
2021-12-16 12:07:50 +00:00
str4d a5de219cee
Merge pull request #258 from zcash/ci-benchmarks
CI: Benchmark tweaks
2021-12-15 23:14:33 +00:00
Jack Grigg ab930e8866 sinsemilla: Simplify assertions in `MessagePiece::from_bitstring`
Also fixes some incorrect code comments.

Closes zcash/orchard#263.
2021-12-15 22:15:00 +00:00
Carlos Pérez 8cedfe89de
Change to `Into<Column<Any>>` for pub API methods (#416)
Resolves: zcash/halo2#345
2021-12-15 17:05:31 +00:00
str4d c19423766b
Merge pull request #415 from ChihChengLiang/hint-on-meta-enable-equality
improve error message on ColumnNotInPermutation
2021-12-15 16:52:22 +00:00
Jack Grigg 1be54d9f0d Use `<= PrimeField::CAPACITY` instead of `< PrimeField::NUM_BITS` 2021-12-15 15:42:05 +00:00
Jack Grigg 5dd7de3cc7 Remove all uses of `PrimeField::Repr` in generic code
`PrimeField::from_repr` explicitly leaves the endianness opaque. We
therefore can't use it in places we were using `FieldExt::from_bytes`
(which was specifically little-endian) generically, but the previous
commit replaced it everywhere. We now handle generic contexts on a
case-by-case basis:

- Where we needed to convert bitstrings into field elements, we now use
  double-and-add on the field elements directly instead of on bytes.
  This is less efficient, but visible correct (and a future change to
  the `ff` crate APIs could enable the more efficient version).

- `INV_TWO_POW_K`, which is pre-computed for `pallas::Base`, was being
  incorrectly used in a field-generic circuit. We now compute it live.

- `test_zs_and_us` was only used in tests, and hard-coded a field
  element encoding length of 32 bytes. It now uses Pallas concretely.
2021-12-15 15:28:32 +00:00
Jack Grigg 044844c0a0 Reject the identity in `SpendValidatingKey::from_bytes`
`ak_P` is not allowed to be the identity in the Orchard protocol. We
were enforcing this by construction in most places, except for the
parsing of an Orchard full viewing key.

Closes zcash/orchard#261.
2021-12-15 13:48:59 +00:00
str4d 8a4f4e347b
Merge pull request #259 from zcash/222-rewrite-poseidon
Rewrite Poseidon implementation
2021-12-15 13:28:26 +00:00
Jack Grigg 8fe178e433 poseidon: Seal the sponge modes
A sponge can only have two modes: absorbing, and squeezing.
2021-12-15 13:08:08 +00:00
str4d 5948a4977a
poseidon: Update code comments
Also fixes some clippy lints (public docs linking to private items).

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-12-15 13:04:54 +00:00
str4d a64e2d64a8
poseidon: Remove `M: SpongeMode` from `PhantomData`
`M` was at one point only used as a type marker, but now it stores per-mode state.

Co-authored-by: ying tong <yingtong@z.cash>
2021-12-15 13:01:53 +00:00
Jack Grigg bb7b132530 Fix addition of `Assigned::Rational`
If the rational would evaluate to zero, we need to ignore it instead of
using its denominator in normal rational addition equations. This fixes
the tests we added in the last two commits.
2021-12-10 23:41:17 +00:00
Jack Grigg 8be0c6fa08 Add commutativity proptest for `Assigned<F>`
This tests that deferring inversions gives the same result as eagerly
evaluating them. Currently, it does not :)
2021-12-10 18:31:31 +00:00
Jack Grigg 423006b905 poseidon: Remove redundant additions when squeezing sponge
In the previous commit, we fixed a bug where padding was being added to
the state when the sponge was in squeezing mode. But there's no need to
assign a circuit region in which we add constant zeroes to the state :)
2021-12-10 02:40:41 +00:00