-
Notifications
You must be signed in to change notification settings - Fork 66
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
Introduce mul_by_inverse_unchecked
, and use it
#75
Conversation
Do you have a good way to add a regression test for this behaviour? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me (though we need to make sure domain.offset != 0
if we plan to use unchecked
)
Ok I added a check to make sure |
domain.offset should never be zero for multiplicative domains, but I don't think that needs to be proven in circuit. Thats about the circuit definition being valid. (The circuit definition has defined an invalid codeword domain if its zero, the offset derivation shouldn't allow construction of zero domain offsets) |
I think @tsunrise's code require |
Oh I see. If necessary as a temporary defense in depth for correctness seems like an alright fix then. What I'd rather see is we assert this on the DomainVar itself (that its offset and generator are non-zero). Basically in the constructor for DomainVar, include an argument for the inputs being guaranteed to be non-zero. If false, then do the non-zero checks once there. |
Yeah, that's what I changed it to do: r1cs-std/src/poly/domain/mod.rs Line 28 in 213e53d
|
I meant explicitly including an argument to not get a constraint created. Currently it seems like a constraint is always created if offset is not a constant? |
Ah so like a |
Its constructed once per query per round, so ~200 times. |
I see, with a different offset each time? |
Yeah. The offset is based on the query coset |
I think I addressed all comments, except for the Technically, this is a breaking change due to the changes to the (Maybe we should have "in-flux" features hidden behind a |
Description
Resolves #70 (comment).
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer