Commit Graph

26 Commits

Author SHA1 Message Date
Edward Chen
75572c6a2c C Frontend (#22) 2022-01-20 10:16:27 -08:00
Alex Ozdemir
f2744e0c06 IR-based Zokrates front-end (#33)
The ZoKrates front-end now represents ZoK arrays as IR arrays, and ZoK structures as (type-tagged) IR tuples.

During this change, I discovered that IR support for eliminating tuples and arrays was not complete.

Thus the change list is:

    The ZoK front-end uses IR arrays and tuples
    Improve IR passes for array and tuple elimination
    Enforce cargo fmt in CI
    Bugfix: handle ZoK accessors in L-values in the correct order
    Bugfix: add array evaluation to the IR

This PR does not:

    implement an array flattening pass
    implement permutation-based memory-checking

Benefits:

    The ZoK->R1CS compiler is now ~5.88x faster (as defined by the time it takes to run the tests in master's scripts/zokrates_test.zsh script: this goes from 8.59s to 1.46s)
        For benchmarks with multi-dimensional arrays, the ZoK->R1CS compiler can now compile them with reasonable speed. Before it it would time out on even tiny examples.
    The ZoK->R1CS compiler will be able to benefit from future memory-checking improvements
    IR support for arrays and tuples is complete now, making those parts of the IR more accessible to future front-ends.

alex-ozdemir added 21 commits 11 days ago
2022-01-01 11:44:56 -08:00
Alex Ozdemir
8914c007cd Public inputs for proofs. (#27) 2021-12-10 13:09:05 -08:00
Alex Ozdemir
4ffa05fca6 Datalog (#26)
Support a datalog variant.
2021-11-30 13:26:25 -08:00
Alex Ozdemir
8a05a107ed Deterministic compilation & better CLI (#25)
This PR makes compilation deterministic (by switching to fxhash) and improves the CLI.

Technically, the std-based hash tables cannot be guaranteed to have the deterministic iteration order that we need, regardless of what hash you use, so I've added some micro-tests for the property that we need. I'm not optimistic about getting better guarantees from std, but I'll try.

The CLI has also changed.
2021-11-29 15:17:32 -08:00
Alex Ozdemir
efe0d62263 Proof of high-value & tests 2021-10-18 15:29:37 -07:00
Edward Chen
92cff0a119 Integrated EZPC helper file (#18)
* Added EZPC helper file, updated output, added shift tests
2021-09-02 18:08:08 -04:00
Edward Chen
d9d66896b3 Added support for multiple outputs in test cases (#17) 2021-08-31 19:24:14 -07:00
Edward Chen
fd2a7e4bf2 Added Conversion Gates & Integrated with OPA SharingMap (#16)
* OPA-by-ILP benchmark example

* Reverted unverified push to master branch

* Added conversion gates and integrated ABY lowering with SharingMap

Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
2021-08-25 22:38:50 -07:00
Edward Chen
5579b99888 Revert "Added conversion gates and integrated SharingMap"
This reverts commit bd022fad38.
2021-08-25 16:48:07 -04:00
Edward Chen
bd022fad38 Added conversion gates and integrated SharingMap 2021-08-25 16:45:24 -04:00
Alex Ozdemir
fa711e6900 ZoKrates->ILP toolchain and tests (#10) 2021-08-07 00:08:46 -07:00
Edward Chen
68da42993c Zok to ABY pipeline (#4)
Lowering layer from CirC IR to ABY 
- Lowers IR to ABY C++ 
- Writes translated code into ABY submodule and update CMake files
- tests using Python to run ABY executables

Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
2021-07-28 21:33:21 -07:00
Alex Ozdemir
22a5e508fe Don't use equality assertions pervasively.
Also: special case ZoK entry fn return for proof/smt/MPC
2021-07-07 11:48:31 -07:00
Alex Ozdemir
1247e2cf6f ZoKrates MPC party numbers
Adds:
* Parsing party numbers from private annotations (e.g. private<1>, private<2>, ...)
* A "mode" flag to the ZoKrates generator which is either Proof or Mpc(party_count)
* Appropriate generation
* Modifications to the circ driver
* two tests
2021-06-26 00:40:13 -07:00
Alex Ozdemir
fad440db7f Tests 2021-06-25 23:56:51 -07:00
Alex Ozdemir
0e2e9e10cc Fix model parsing by updating rsmt2
Apparently the most up-to-date version is here[1], not in Adrien's
repository.

[1]: https://github.com/kino-mc/rsmt2
2021-04-27 19:59:39 -07:00
Alex Ozdemir
96f5894add Doc everything. 2021-04-27 14:41:56 -07:00
Alex Ozdemir
38b6593cb9 Opts 2021-03-15 02:01:50 -07:00
Alex Ozdemir
3eda1991c0 Basic bellman backend 2021-02-28 15:57:32 -08:00
Alex Ozdemir
fcfe7e84f0 Misc ZoKrates opts
* SHA CH function
* better Uext conversion
* better (more propagate-able) small XORs
2021-02-27 09:20:40 -08:00
Alex Ozdemir
f564cf0dfa Zokrate & perf improvements 2021-02-26 20:26:50 -08:00
Alex Ozdemir
b757b5c14c Tune optimizer 2021-02-24 14:04:33 -08:00
Alex Ozdemir
23fd01f823 eq elim ckpt 2021-02-22 16:37:42 -08:00
Alex Ozdemir
8c5dfdcbbd Zokrates gen, draft 1 complete. Not really tested 2021-02-20 12:38:14 -08:00
Alex Ozdemir
3b155a7aab start interpreting ZoKrates 2021-02-19 00:56:46 -08:00