1876 Commits

Author SHA1 Message Date
wborgeaud
9b65825572 Comments 2022-03-28 14:24:29 +02:00
wborgeaud
e50e668f7e PR feedback + use only one selector when possible 2022-03-28 10:15:06 +02:00
wborgeaud
283c9350a7 No doc-test 2022-03-25 08:24:32 +01:00
wborgeaud
19cbbd4d12 Minor 2022-03-25 08:01:22 +01:00
wborgeaud
847565a8c3 Comments 2022-03-25 07:52:39 +01:00
wborgeaud
d6b99df876 Cleaning 2022-03-25 06:36:04 +01:00
wborgeaud
1d77116ef3 Working 2022-03-24 07:19:48 +01:00
Jakub Nabaglo
06fef55bfb
u32 division (#517)
* First draft for division.

* `eval_division` work

* Division

* Minor: outdated fixme

* Tests and better column names

* Minor lints

* Remove redundant constraint

* Make division proof more formal

* Minor proof and comments

Co-authored-by: Hamish Ivey-Law <hamish@ivey-law.name>
2022-03-23 10:41:36 -07:00
wborgeaud
c6ebd06907 Not working yet 2022-03-23 15:47:22 +01:00
wborgeaud
7cf3220439 Rollback 2022-03-23 14:16:02 +01:00
wborgeaud
185d8faef6 Progress 2022-03-23 14:06:09 +01:00
wborgeaud
68bd0f4b3d Not working 2022-03-23 07:27:06 +01:00
wborgeaud
2cedd1b02a
Merge pull request #521 from mir-protocol/fix_inv_mod_xn
Fix inv mod xn
2022-03-21 06:13:06 +01:00
wborgeaud
163053b8fa Use truncate instead of drain 2022-03-21 05:34:36 +01:00
Daniel Lubarov
482dfe559a
Vectorize constraint evaluation in Starky (#520) 2022-03-20 08:58:23 -07:00
wborgeaud
744996ef1c Remove remove_prefix 2022-03-20 10:19:22 +01:00
wborgeaud
dbaa31d818 Back to slice 2022-03-20 10:13:01 +01:00
wborgeaud
3b767ca42f a_deg should be degree of a 2022-03-20 07:26:40 +01:00
wborgeaud
6a6414163a Fix inv_mod_xn 2022-03-20 07:23:51 +01:00
wborgeaud
ddd5192489 Move secret_to_public to a ECDSASecretKey method 2022-03-18 08:04:40 +01:00
wborgeaud
c472afe12e Merge branch 'main' into glv
# Conflicts:
#	ecdsa/src/curve/ecdsa.rs
#	plonky2/src/gadgets/ecdsa.rs
2022-03-18 07:19:28 +01:00
wborgeaud
296b21aed9 Not working 2022-03-17 11:48:44 +01:00
wborgeaud
e77383b559 Progress 2022-03-17 11:08:25 +01:00
Daniel Lubarov
7d6c0a448d
Halo2 style lookup arguments in System Zero (#513)
* Halo2 style lookup arguments in System Zero

It's a really nice and simple protocol, particularly for the verifier since the constraints are trivial (aside from the underlying batched permutation checks, which we already support). See the [Halo2 book](https://zcash.github.io/halo2/design/proving-system/lookup.html) and this [talk](https://www.youtube.com/watch?v=YlTt12s7vGE&t=5237s) by @daira.

Previously we generated the whole trace in row-wise form, but it's much more efficient to generate these "permuted" columns column-wise. So I changed our STARK framework to accept the trace in column-wise form. STARK impls now have the flexibility to do some generation row-wise and some column-wise (without extra costs; there's a single transpose as before).

* sorting

* fixes

* PR feedback

* into_iter

* timing
2022-03-16 17:37:34 -07:00
wborgeaud
63a3090452 Start selectors 2022-03-16 18:09:36 +01:00
wborgeaud
deec6a784c
Merge pull request #516 from mir-protocol/ecdsa_module
Move nonnative/curve/ecdsa code to `ecdsa` module
2022-03-16 18:06:51 +01:00
wborgeaud
786c1eafcf Minor 2022-03-16 05:44:02 +01:00
wborgeaud
534ee7d637 Add untracked files 2022-03-16 05:39:45 +01:00
wborgeaud
660d785ed1
Merge pull request #515 from mir-protocol/fix_salt_issue
Fix salt issues
2022-03-16 03:40:59 +01:00
Daniel Lubarov
627e80bfd5
Filter mul-add constraints (#512) 2022-03-15 09:24:10 -07:00
wborgeaud
cc9a43b574 Fix salt issues 2022-03-15 17:14:45 +01:00
wborgeaud
2e5c2e8984 Add ecdsa module 2022-03-15 16:55:08 +01:00
wborgeaud
50f722d83e
Merge pull request #511 from mir-protocol/gadget_curve_msm
Gadget for curve MSM, fixed-base scalar multiplication and ECDSA verification in under `2^17` or `2^16` gates
2022-03-05 02:50:57 +01:00
wborgeaud
954eaf16f2 PR feedback 2022-03-05 02:36:08 +01:00
Hamish Ivey-Law
310493c293
Faster extension field multiplication (#500)
* Initial implementation of quintic extensions.

* Update to/from_biguint() methods.

* Draft of fast multiplication on quintic extensions over 64-bit base.

* cargo fmt

* Typo.

* Document functions (a bit).

* Refactor reduction step.

* Change multiplication call so that LLVM generates better assembly.

* Use one main accumulator instead of two minor ones; faster reduce.

* Use one main accumulator in square too; clean up redundant code.

* Call faster routines from Mul and Square impls.

* Fix reduction function.

* Fix square calculation.

* Slightly faster reduction.

* Clean up names and types.

* cargo fmt

* Move extension field mul/sqr specialisations to their own file.

* Rename functions to have unique prefix.

* Add faster quadratic multiplication/squaring.

* Faster quartic multiplication and squaring.

* cargo fmt

* clippy

* Alternative reduce160 function.

* Typo.

* Remove alternative reduction function.

* Remove delayed reduction implementation of squaring.

* Enforce assumptions about extension generators.

* Make the accumulation variable a u32 instead of u64.

* Add test to trigger carry branch in reduce160.

* cargo fmt

* Some documentation.

* Clippy; improved comments.

* cargo fmt

* Remove redundant Square specialisations.

* Fix reduce*() visibility.

* Faster reduce160 from Jakub.

* Change mul-by-const functions to operate on 160 bits instead of 128.

* Move code for extensions of GoldilocksField to its own file.
2022-03-04 09:34:31 +11:00
wborgeaud
3a68a458c4 Ignore large tests 2022-03-03 08:44:27 +01:00
wborgeaud
5febea778b Fixes 2022-03-03 08:14:56 +01:00
wborgeaud
18e341ff18 Comments 2022-03-03 08:06:21 +01:00
wborgeaud
47523c086a Minor 2022-03-03 07:59:47 +01:00
wborgeaud
90df0d9d3a Clippy 2022-03-03 07:59:44 +01:00
wborgeaud
f6525ed11a Add wide config for ECDSA in < 2^16 gates 2022-03-03 07:59:32 +01:00
Daniel Lubarov
7329dade94
IS_MUL -> IS_MUL_ADD (#510) 2022-03-02 22:49:57 -08:00
Hamish Ivey-Law
2644f5f74a
System Zero subtraction operation (#508)
* First draft of subtraction operation.

* Daniel comments.

* Fix constraint calculation.

* cargo fmt

* Align native and recursive eval functions; fix typo.
2022-03-03 14:18:19 +11:00
wborgeaud
c8d3335bce ECDSA verification in 101k gates 2022-03-02 13:37:01 +01:00
wborgeaud
2571862f00 Working GLV decomposition check 2022-03-02 13:31:16 +01:00
wborgeaud
7c70c46ca7 Working GLV with MSM 2022-03-02 13:19:31 +01:00
wborgeaud
850df4dfb1 Add fixed base file 2022-03-02 11:16:32 +01:00
wborgeaud
6f3ca6a0bc Fixed base works 2022-03-02 11:04:05 +01:00
wborgeaud
ba5b1f7278 Fix set_biguint_target 2022-03-02 10:27:20 +01:00
wborgeaud
74cf1d3887 Minor improvement 2022-03-01 07:59:35 +01:00