-
Notifications
You must be signed in to change notification settings - Fork 10
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
175 complete ecdsa bbf #304
base: master
Are you sure you want to change the base?
Conversation
Clang Test Results 177 files + 3 177 suites +3 22m 2s ⏱️ + 1m 26s Results for commit 4039020. ± Comparison against base commit 8b0390b. This pull request removes 1 and adds 11 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Gcc Test Results 177 files +3 177 suites +3 21m 5s ⏱️ + 2m 33s Results for commit 4039020. ± Comparison against base commit 8b0390b. This pull request removes 1 and adds 5 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
bcb84ee
to
d06a946
Compare
d8c0bb6
to
e815fb7
Compare
cbdce3b
to
87e57d0
Compare
9cb02d3
to
2c62d6a
Compare
} | ||
allocate(Q); | ||
|
||
// Add range check for Y if it is negative | ||
if (is_add) { |
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.
Shouldn't this be !is_add ?
} | ||
} | ||
|
||
for (std::size_t i = 0; i < num_chunks; ++i) { | ||
allocate(R[i]); | ||
allocate(Y[i]); |
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.
This is wrong, sorry. You can allocate those Y's but they cant't be connected to your input variables via copy constraints. Actually, instead of using p-y which is very sensible in general, you have do adopt a different strategy to have everything constrained. I guess, that, depending on is_add, you should either prove
x + y = r + pq
or
y + r = x + pq
with range checks on r. Maybe this has to be cross-checked for the second case but I have a feeling it is right.
CopyConstrain(XR, t21); // xR = t21 | ||
auto t22 = MultModP(YR, t20); // t22 = yR(ZPQ + WPQ) | ||
CopyConstrain(YR, t22); // yR = t22 | ||
auto t1 = NegModP(input_xP); // t1 = -xP |
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.
It seems that if we do have substraction, this is no longer needed. It is used to compute -3x_P² further on, but you can replace that with 3x_P² and just do substraction, I guess...
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.
We should probably check if this is used at all now...
|
||
auto [at, A, desc] = B.assign(raw_input); | ||
bool pass = B.is_satisfied(at); | ||
std::cout << "Is_satisfied = " << pass << std::endl; | ||
|
||
assert(pass == true); | ||
if (!is_add) { |
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.
While the circuit needs correction, this is perfectly fine. Please, do not touch these lines :)
Migrated 3 new circuits in bbf:
Normalizing imports and variables accros subcomponents