3496 Commits

Author SHA1 Message Date
Dmitry Vagner
9f808fc78c align 2023-02-07 08:53:23 -08:00
Dmitry Vagner
1c73e23824 fp -> fp254 2023-02-05 17:43:31 -08:00
Dmitry Vagner
61ac0eff46 fmt 2023-02-05 17:40:45 -08:00
Dmitry Vagner
0f030fae4a naming for global labels 2023-02-05 17:40:04 -08:00
Dmitry Vagner
c107c5055e comments 2023-02-01 19:30:04 -08:00
Dmitry Vagner
e1dca8703c name 2023-02-01 19:19:36 -08:00
Dmitry Vagner
962754be99 rand impl 2023-02-01 19:15:56 -08:00
Dmitry Vagner
a950a26266 add comments 2023-02-01 18:57:50 -08:00
Dmitry Vagner
cd5c92b574 merge 2023-02-01 08:51:42 -08:00
wborgeaud
ca002aeafa
Optimize ecrecover ASM (#840)
* windowed mul

* Working

* Window of 4 bits

* Fix

* Comments

* Unroll loop

* Unroll loop

* remove global

* Minor

* Minor

* Implement `CALLVALUE, CALLDATALOAD, CALLDATASIZE, CALLDATACOPY` in interpreter

* Minor

* Doesn't work

* Minor

* Minor

* wnaf msm

* Working hardcoded values: 28657 opcodes

* Working wnaf

* Small wnaf optim

* Precompute works

* Working together

* Bump to 129 bits

* Working glv decomposition

* Working MSM with GLV

* Almost working

* Working

* ECC test folder

* Working with real sig data

* Fix tests + Clippy

* Minor

* Cleaning

* Comments

* Cleaning

* Smaller glv test file

* Print opcode count at the end of interpreter run

* More constants

* Add z3 proof that the GLV scalars are 129-bit or less

* Minor change to z3 proof

* Minor

* Hamish's suggestion

* Working

* Cleaning

* Clippy

* PR feedback

* Minor PR feedback
2023-01-31 19:23:54 +01:00
Daniel Lubarov
9990632f48
Merge pull request #870 from mir-protocol/prep_for_publish
Prep for publishing to crates.io
2023-01-30 13:50:51 -08:00
Daniel Lubarov
137bc78565 Prep for publishing to crates.io 2023-01-30 13:18:06 -08:00
Daniel Lubarov
815113809a TODO 2023-01-30 08:43:52 -08:00
Hamish Ivey-Law
6c4ef29fec
Add range checks to the arithmetic Stark (#866)
* Simplify loop and remove clippy.

* Offset auxiliary coefficients so they're always positive.

* Split mul aux input into lo/hi parts.

* Rename register.

* Combine `QUO_INPUT_{LO,HI}`; rearrange some columns.

* Split `MODULAR_AUX_INPUT` into high and low pieces.

* Remove range_check_error debug output.

* First draft of generating the range checks.

* Remove opcodes for operations that were defined elsewhere.

* Clean up interface to build arithmetic trace.

* Fix "degree too high" bug in DIV by zero.

* Fix constraint_transition usage in recursive compare.

* Fix variable name; use named constant.

* Fix comment values.

* Fix bug in recursive MUL circuit.

* Superficial improvements; remove unnecessary genericity.

* Fix bug in recursive MULMOD circuit.

* Remove debugging noise; expand test.

* Minor comment.

* Enforce assumption in assert.

* Make DIV its own operation.

* Make MOD it's own operation; rename structs; refactor.

* Expand basic test.

* Remove comment.

* Put Stark operations in their own file.

* Test long traces.

* Minor comment.

* Address William's comments.

* Use `const_assert!` instead of `debug_assert!` because Clippy.
2023-01-31 02:23:24 +11:00
Dmitry Vagner
aed617c1de Merge branch 'main' of github.com:mir-protocol/plonky2 into non-inv 2023-01-28 14:18:00 +08:00
Dmitry Vagner
ea01e19c41 comment 2023-01-28 14:17:55 +08:00
Dmitry Vagner
5b124fb121 minor 2023-01-26 10:42:31 +07:00
Dmitry Vagner
6e8d4a57a4 fix 2023-01-25 16:48:28 +07:00
Dmitry Vagner
0eef28af66 bools 2023-01-25 16:41:42 +07:00
Dmitry Vagner
3ea8ad9062 fmt 2023-01-25 16:26:50 +07:00
Dmitry Vagner
6958d46c56 names and comments 2023-01-25 16:26:41 +07:00
Dmitry Vagner
56be7317e0 comments 2023-01-25 16:20:24 +07:00
Dmitry Vagner
b46af11f3a move consts 2023-01-25 16:10:53 +07:00
Dmitry Vagner
f70243e70c better comments 2023-01-25 15:31:32 +07:00
Dmitry Vagner
f0a6ec9535 clean asm 2023-01-25 14:42:30 +07:00
wborgeaud
136cdd053f
Remove InterpolationGate trait (#868) 2023-01-25 08:29:51 +01:00
Dmitry Vagner
9c8f11666f ocd 2023-01-25 14:15:46 +07:00
Dmitry Vagner
d98c69f0bc better comments 2023-01-25 14:12:29 +07:00
Dmitry Vagner
0b81258af3 stack macros 2023-01-24 17:18:13 +07:00
Jim Posen
3bdb290746
Optimized interpolation gate (#861)
* New implementation of InterpolationGate

* Use CosetInterpolationGate in recursive verifier

* Minimize the degree of interpolation gate

Minimize the degree if it doesn't increase the number of wires or constraints. This allows for more efficiency with selectors.

* Include tests for number of wires and constraints

* Run rustfmt

* Run cargo fmt

* Fix documentation typo

Co-authored-by: wborgeaud <williamborgeaud@gmail.com>

* Fix clippy issue

Co-authored-by: wborgeaud <williamborgeaud@gmail.com>
2023-01-24 11:12:41 +01:00
Dmitry Vagner
c9b005d22e new power works 2023-01-24 17:08:29 +07:00
Dmitry Vagner
5deb164865 refactor power 2023-01-24 16:35:49 +07:00
Dmitry Vagner
60cbdde879 clean 2023-01-24 14:56:15 +07:00
Dmitry Vagner
8ca6ba7bde clean 2023-01-24 09:43:47 +07:00
Dmitry Vagner
c13cf97237 tate test 2023-01-24 09:42:42 +07:00
Dmitry Vagner
75c5938c49 rewrite w methods 2023-01-24 00:01:47 +07:00
Dmitry Vagner
ec4cddb7c9 inv as method 2023-01-23 14:59:08 +07:00
Dmitry Vagner
7b52438173 en route to ownership 2023-01-21 16:38:43 +07:00
Dmitry Vagner
17cfae6655 reorg 2023-01-21 16:15:27 +07:00
Dmitry Vagner
f34b35eda2 extra comments 2023-01-21 16:11:32 +07:00
Dmitry Vagner
94d99cca9e extra comments 2023-01-21 15:55:45 +07:00
Dmitry Vagner
8b670d54d1 meh 2023-01-21 14:26:38 +07:00
Dmitry Vagner
769c615cf1 cleanup 2023-01-21 14:17:01 +07:00
Dmitry Vagner
530fb65b7e cleanup 2023-01-21 13:52:26 +07:00
Dmitry Vagner
155e973d06 slight refactor 2023-01-21 13:24:45 +07:00
Dmitry Vagner
d2aa937a2f improved prover input and test api 2023-01-21 13:19:07 +07:00
Dmitry Vagner
e06a2f2d46 duh 2023-01-21 00:56:38 +07:00
Dmitry Vagner
a5c292c751 space 2023-01-21 00:33:09 +07:00
Dmitry Vagner
4d783da82d fmt 2023-01-20 16:05:27 +07:00
Dmitry Vagner
d99cadebc2 stack macro 2023-01-20 16:03:24 +07:00