Add support for ZoKrates with curly brackets (wip)#211
Add support for ZoKrates with curly brackets (wip)#211alex-ozdemir merged 28 commits intocircify:masterfrom
Conversation
We jsut copy pasted the existing frontend and updated the configurations and scripts to support both Zokrates frontends
alex-ozdemir
left a comment
There was a problem hiding this comment.
This is a very nice patch, Stefanos. I have a few questions about it, but I think they should be easy to address.
Also adds missing tests for tuples
alex-ozdemir
left a comment
There was a problem hiding this comment.
This looks good to me now.
If you're happy with it, then I'll merge it.
| } | ||
| } | ||
|
|
||
| fn assembly_assign_impl_<const IS_CNST: bool>( |
There was a problem hiding this comment.
@alex-ozdemir, can you review this code?
| } | ||
| } | ||
|
|
||
| fn assembly_constraint_<const IS_CNST: bool>( |
There was a problem hiding this comment.
Here I just add the assembly constraints like it was an assertion.
|
I think that if we make sure that assembly is handled correctly, then we can proceed. ref: https://zokrates.github.io/language/assembly.html |
|
Is the omission of |
| } | ||
| } | ||
|
|
||
| pub fn field_to_bool_unsafe(f: T) -> Result<T, String> { |
There was a problem hiding this comment.
I think that you actually want this operator using it will maintain the connection between the input and the output of the operator in the final constraint system, it will just assume that the value is 0 or 1. See this part of R1CS lowering.
What do you think?
There was a problem hiding this comment.
Thanks, that makes sense! Should we still wrap it in a new_witness Op? If we do so, in the test, should we also pass the new_witness value?
There was a problem hiding this comment.
Thanks, that makes sense! Should we still wrap it in a new_witness Op?
No, you should not.
|
Sorry for the delay. It was not intentional; I tried to implement it (without changing the IR), but the test failed. |
alex-ozdemir
left a comment
There was a problem hiding this comment.
(A change may not be necessary---see my comment and let me know what you think.)
| } | ||
| } | ||
|
|
||
| pub fn field_to_bool_unsafe(f: T) -> Result<T, String> { |
There was a problem hiding this comment.
I think that you actually want this operator using it will maintain the connection between the input and the output of the operator in the final constraint system, it will just assume that the value is 0 or 1. See this part of R1CS lowering.
What do you think?
|
@alex-ozdemir fixed the issues, now the mpc tests fail. Seems like we miss libcrypto: |
|
Hi @StefanosChaliasos , We've dodged the issue with ABY's testing infrastructure. (#221) |
Including: removing ABY's testing from the CI since the test infrastructure is pinned to specific a specific Ubuntu version.
|
Great, thanks! I think it's ready to be merged |
|
Wonderful, it's great to have this in! |
This PR tries to address #208.
Some of the features that are not supported by the grammar are:
Furthermore, we don't currently support MPC.
Finally, the implementation of assembly has not been tested and shouldn't be complete.
All the tests pass. To run them, you can use the following commands:
The changes to support ZoKrates with curly brackets are the following:
third_party/ZoKratesCurly.src/front/zsharpcurly.zokc.circexecutable to support zsharpcurly and implementedzcxi.TODOs:
Note that you can check the changes vs the original implementation in the first 4 commits of this PR.