Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

fix: make exp gadget compatible with circuits impl#300

Merged
roynalnaruto merged 3 commits into
privacy-ethereum:masterfrom
scroll-tech:fix/exp-circuit-compat
Nov 1, 2022
Merged

fix: make exp gadget compatible with circuits impl#300
roynalnaruto merged 3 commits into
privacy-ethereum:masterfrom
scroll-tech:fix/exp-circuit-compat

Conversation

@roynalnaruto
Copy link
Copy Markdown
Collaborator

@roynalnaruto roynalnaruto commented Oct 29, 2022

We define a boolean variable single_step where:

  • single_step == 1 if exponent == 2
  • single_step == 0 if exponent > 2

We don't need any additional constraints on single_step (not even require_boolean) because it is simply used to do a lookup to the exponentiation circuit. All necessary constraints on that column (exp_circuit.exp_table.is_last) are handled within the exponentiation circuit.

This makes the specs gadget compatible with the circuits gadget

@adria0 This is the last pending PR before we can get privacy-ethereum/zkevm-circuits#700 merged

Copy link
Copy Markdown
Collaborator

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roynalnaruto roynalnaruto merged commit 1a632d6 into privacy-ethereum:master Nov 1, 2022
@roynalnaruto roynalnaruto deleted the fix/exp-circuit-compat branch November 1, 2022 07:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants