-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate constraints in black box functions #74
Draft
ilitteri
wants to merge
30
commits into
main
Choose a base branch
from
generate_constraints_in_black_box_functions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Due to the new fixed bugs, new test programs could run properly using our backend
…k into update_test_programs
- AND - XOR - RANGE - SHA256 - Blake2s - HashToField128Security - EcdsaSecp256k1
* Add first implementation of gadget * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Add function to get the one wire's index * Fix function signature * Improve documentation * Add secret variables instead of internal ones for the intermediate variables * Return the mutated secret variables * Refactor a function (abstract it from the ACIR) * Add tests for `assertIsBoolean` component * Fix `assertIsBoolean` constraint component * Remove useless function * Update naming * Fix
* Add first implementation of gadget * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Add function to get the one wire's index * Fix function signature * Improve documentation * Add secret variables instead of internal ones for the intermediate variables * Return the mutated secret variables * Refactor a function (abstract it from the ACIR) * Add tests for `assertIsBoolean` component * Add tests for bit and component * Add bit and component * Add multiple-bit and component * Update result's secret variable name * Fix `assertIsBoolean` constraint component * Remove useless function * Update naming * Fix * Add `assertIsEqual` component * Refactor repeated code in tests * Add `assertIsEqual` component tests * Implement `add` `mul` & `assertIsEqual` components * Fix `toBinaryConversion` component * Update secret variables naming * Add `toBinaryConversion` tests * Remove print * Add missing boolean assertion when converting to binary * Improve variable labels * Fix `toBinaryConversion` * Flag to generate constraint over `and` inputs * Update `And` * Shift coefficient after every iteration * Implement `fromBinaryConversion` component * Update tests naming * Finish `And` implementation * Update `accumulator` label name * Remove needless boolean assertion It is asserted above * Document components * Cleanup components * Rename module * Doc `assertIsEqual`
* Add first implementation of gadget * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Add function to get the one wire's index * Fix function signature * Improve documentation * Add secret variables instead of internal ones for the intermediate variables * Return the mutated secret variables * Refactor a function (abstract it from the ACIR) * Add tests for `assertIsBoolean` component * Add tests for bit and component * Add bit and component * Add multiple-bit and component * Update result's secret variable name * Add xor component implementation Both for bit-to-bit and multiple bits * Fix append * Add tests for single bit xor * Fix `assertIsBoolean` constraint component * Remove useless function * Update naming * Fix * Add `assertIsEqual` component * Refactor repeated code in tests * Add `assertIsEqual` component tests * Implement `add` `mul` & `assertIsEqual` components * Fix `toBinaryConversion` component * Update secret variables naming * Add `toBinaryConversion` tests * Remove print * Add missing boolean assertion when converting to binary * Improve variable labels * Fix `toBinaryConversion` * Flag to generate constraint over `and` inputs * Update `And` * Shift coefficient after every iteration * Implement `fromBinaryConversion` component * Update tests naming * Finish `And` implementation * Update `accumulator` label name * Remove needless boolean assertion It is asserted above * Document components * Cleanup components * Rename module * Doc `assertIsEqual` * Finish `Xor` & `xor` components implementations * Update doc
* Add first implementation of gadget * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Update gnark_backend_ffi/backend/plonk/components.go * Add function to get the one wire's index * Fix function signature * Improve documentation * Add secret variables instead of internal ones for the intermediate variables * Return the mutated secret variables * Refactor a function (abstract it from the ACIR) * Add tests for `assertIsBoolean` component * Add tests for bit and component * Add bit and component * Add multiple-bit and component * Update result's secret variable name * Add xor component implementation Both for bit-to-bit and multiple bits * Fix append * Add tests for single bit xor * Fix `assertIsBoolean` constraint component * Remove useless function * Update naming * Fix * Add `assertIsEqual` component * Refactor repeated code in tests * Add `assertIsEqual` component tests * Implement `add` `mul` & `assertIsEqual` components * Fix `toBinaryConversion` component * Update secret variables naming * Add `toBinaryConversion` tests * Remove print * Add missing boolean assertion when converting to binary * Improve variable labels * Fix `toBinaryConversion` * Flag to generate constraint over `and` inputs * Update `And` * Shift coefficient after every iteration * Implement `fromBinaryConversion` component * Update tests naming * Finish `And` implementation * Update `accumulator` label name * Remove needless boolean assertion It is asserted above * Document components * Cleanup components * Rename module * Doc `assertIsEqual` * Finish `Xor` & `xor` components implementations * Update doc * Update variable usage In the previous iteration, only secret variables were assumed to be the only ones used for the component. In reality, both secret and public variables could be used with components. Given that in components, the intermediate variables are treated as secret, then we must track them, but we also need to use the full variables vector (public+secret in order). This is just another iteration, it seems that having some mutable Context data structure would clean the code a lot, because it is really messy as it is and the user must take care of updating the secret, and the full variables vectors. * `HandleValues` returns a full variables vector too Public + secret in order * Both `handleOpcodes`and `handleBlackBoxFunctionOpcode` must now return the added secret variables (that are the internal ones). If we manage to handle these internal variables as internal and not as secret, this would be useless. * First iteration of integrating AND & XOR opcodes On this iteration we do not handle the `variablesMap` and we do not compare the incoming output with the computed one. * Bring back Go tests At the moment we're just running Plonk's components tests because the ACIR's are to be fixed * Update package name * Sort imports * Update imports * Add missing function * `Context` refactor (#76) * Add `Context` * Handle `Context` in components * Update tests * Comment out `go` job until fixed * Temporarily fix integration For some reason, having a third level module (`components`) makes the `cc` crate not to compile when building `nargo`. It seems that the module is not being found.
…k into generate_constraints_in_black_box_functions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
AND
.XOR
.RANGE
.SHA256
.Blake2s
.HashToField128Security
.