Commit Graph

812 Commits

Author SHA1 Message Date
str4d 87362e22d4
Merge pull request #199 from zcash/upstream-perm-struct
Upstream Permutation struct into plonk::circuit
2021-02-26 04:24:00 +13:00
therealyingtong 4f17322c2d Allow Chip::load to return state that the Layouter will hold
This enables chips that e.g. want to load multiple lookup tables into
the same columns to store state about where each table was layed out.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-02-24 23:28:18 +08:00
therealyingtong 6cbf32c2cd Add FixedPoints type and trait to ECC gadget 2021-02-24 23:24:53 +08:00
ebfull 84c63e5e84
Merge pull request #205 from daira/document-msrv
Add documentation of Minimum Supported Rust Version.
2021-02-23 11:58:03 -07:00
therealyingtong 4ae21a905d Update tests 2021-02-24 00:21:12 +08:00
therealyingtong 5a341b0f8f Modify Assignment::copy() to take Column<Any> instead of usize 2021-02-24 00:18:22 +08:00
therealyingtong d82a0c85b1 Modify Assignment::copy() to take Permutation instead of usize 2021-02-24 00:17:29 +08:00
therealyingtong 340fb2b6df Move Permutation struct from crate::circuit -> plonk::circuit 2021-02-24 00:17:29 +08:00
ebfull 20bd44f854
Merge pull request #191 from zcash/sha-256-gadget-namespacing
Alter the SHA-256 gadget to require namespacing
2021-02-23 08:49:03 -07:00
ebfull 98896560fd
Merge pull request #203 from zcash/newtype-region-idx
Add circuit::RegionIndex and circuit::RegionStart newtypes
2021-02-23 08:20:19 -07:00
ebfull 20e336390e
Merge pull request #206 from zcash/book-sarkar
book: Move Sarkar explanation to implementation section
2021-02-23 08:19:18 -07:00
Jack Grigg 668bd8e89a book: Tidy up Sarkar explanation and make adjustments for clarity 2021-02-23 14:01:47 +00:00
Jack Grigg b2d91140e7 book: Move Sarkar explanation into implementation section 2021-02-23 14:01:47 +00:00
Daira Hopwood 6f4c2dc0d7 Add documentation of Minimum Supported Rust Version.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-23 13:29:07 +00:00
ebfull c5c0dbe190
Merge pull request #204 from zcash/parameter-gen
Generate parameters using hash to curve
2021-02-22 16:40:02 -07:00
ebfull 2e8af8f0ca
Merge pull request #198 from zcash/book-sarkar
[book] Add Sarkar sqrt explanation to Fields section
2021-02-22 16:39:23 -07:00
Sean Bowe 12230a49e0
Move CURVE_ID to CurveExt. 2021-02-22 16:30:05 -07:00
Sean Bowe 75bb8121fb
Switch to domain prefix based on what is suggested in #182 by @daira. 2021-02-22 16:13:11 -07:00
Sean Bowe 1078f854e3
Remove BLAKE2B_PERSONALIZATION constant. 2021-02-22 15:53:22 -07:00
Sean Bowe 5503517ac1
Produce URS using `hashtocurve` logic. 2021-02-22 15:50:01 -07:00
Sean Bowe df8dcce042
Add CurveExt and AffineExt associated types to project Group trait implementations.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-02-22 15:47:57 -07:00
ebfull a7b9ca44f8
Merge pull request #202 from zcash/group-traits
Migrate to group traits
2021-02-22 13:37:02 -07:00
Jack Grigg b4ed5295fe Migrate to group traits
The `Curve` trait is now `CurveExt: group::prime::PrimeCurve`, and
`CurveAffine` is now `CurveAffine: group::prime::PrimeCurveAffine`.

There is no `CurveAffine` trait in `group`, and it's a widely-used
trait in this crate, so we don't rename it to `CurveAffineExt`.
2021-02-22 20:20:23 +00:00
Jack Grigg 55fb581f17 Define hash-to-curve over Curve, not CurveAffine
This removes an unnecessary layer of indirection from the type system,
and ensures that these APIs depend on the halo2-specific trait with the
extensions we require.
2021-02-22 20:12:10 +00:00
Jack Grigg 082d66d6e7 pasta: Reorganize the curve macro
This will make the migration to group easier to review.
2021-02-22 20:05:12 +00:00
Jack Grigg 7037d55320 Rename Curve and CurveAffine properties to match group traits 2021-02-22 20:05:08 +00:00
Jack Grigg 81a7936d99 pasta: Split halo2-specific curve-specific logic into a separate macro 2021-02-22 18:53:27 +00:00
ebfull 627d729836
Merge pull request #136 from daira/hash-to-curve
Hash to curve
2021-02-22 10:24:36 -07:00
Sean Bowe e93de2c285
Avoid heap allocations within hash_to_curve. 2021-02-22 10:15:30 -07:00
Daira Hopwood 16e5f96f3f Fix a clippy lint.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-22 16:02:38 +00:00
Daira Hopwood e408a351d5 Remove a redundant bool::from.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-21 21:43:11 +00:00
Daira Hopwood 7dc21f4727 Repair test vectors and add tests for map_to_curve_simple_swu.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-21 21:01:19 +00:00
Daira Hopwood 24def7ce02 Fix case where the input to map_to_curve_simple_swu is 0, and remove unneeded B_OVER_ZA constants.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-21 21:00:50 +00:00
Daira Hopwood 704a6c3637 Remove unneeded sha3 dependency.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-21 00:45:33 +00:00
Daira Hopwood 642aad68a3
Revert comment changes that are no longer relevant, now that we don't expose the isogenous curves in the API 2021-02-20 21:54:50 +00:00
Daira Hopwood a14eccc13d Remove unused hash support for Pasta Fp and Fq.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-20 21:51:32 +00:00
therealyingtong 84f732acb4 Add circuit::RegionIndex and circuit::RegionStart newtypes 2021-02-20 21:26:42 +08:00
Daira Hopwood 8b8dbbe2bb Refine type of buf in hash_to_field as suggested by @ebfull.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-19 15:52:11 +00:00
Daira Hopwood 6d8c899e16 Rename map_to_curve to map_to_curve_simple_swu.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-19 15:52:11 +00:00
Daira Hopwood 785ad5375c Switch from XOF:SHAKE128 to XMD:BLAKE2b.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-19 15:52:11 +00:00
Daira Hopwood 25ea5d07f7 Fix error in doc comment.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-19 15:52:11 +00:00
Daira Hopwood 9aa3327a0a Fix clippy lints.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-19 15:52:11 +00:00
Sean Bowe c17cd408f1 Fix point doubling on isogenous curve and add test for isogeny of identity. 2021-02-19 15:52:11 +00:00
Sean Bowe a757bc4e43 Update hashtocurve benchmark 2021-02-19 15:52:11 +00:00
Sean Bowe d14d2314a1 Remove isogenous curve from public API. 2021-02-19 15:52:11 +00:00
Sean Bowe b488355e13 Add example to hash_to_curve doc comment. 2021-02-19 15:52:11 +00:00
Sean Bowe dc069dff31 Rename hasher to hash_to_curve. 2021-02-19 15:52:11 +00:00
Sean Bowe f6f008f905 Remove `MINUS_B_OVER_A` constant. 2021-02-19 15:52:11 +00:00
Sean Bowe c48229ce0f Remove dependency on byteorder crate 2021-02-19 15:52:11 +00:00
Sean Bowe 783e602e85 Remove `SimplifiedSWUWithDegree3Isogeny` structure because state is no longer necessary. 2021-02-19 15:52:11 +00:00