-
Notifications
You must be signed in to change notification settings - Fork 36
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
refactor: Implement and integrate rlc
function for simplified lin. combination
#260
Conversation
ef84cb9
to
62963fa
Compare
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 really good! Would it make sense to implement this as an extension of Iterator
where the bounds on Item
are the same as rlc
?
There are many places where this can be used inside of ppsnark.rs
, it will be a nice addition!
We could, but it's essentially a difference in call style
I think ppsnark mostly gathers this under the In any case, beware the algorithmics are a bit different: the power generation is not parallel in the original, but the multiplications are. The |
Extract of the MLKZG bench (which is the one affected by the present PR):
|
62963fa
to
51b3071
Compare
…nation semantics - Introduced a new function `rlc`, which implements Horner's scheme, - Applied traits `Borrow`, `MulAssign`, and `AddAssign` to define it, which exist on `UniPoly`, - Used `rlc` function in `evaluate` method and `kzg_compute_batch_polynomial`, - Updated closures in `mlkzg.rs` file to directly handle vector arguments, simplifying the overall operations. - Streamlined the code by eliminating unnecessary assertions in `kzg_verify_batch` closure and redundant inner function in `kzg_compute_batch_polynomial`.
51b3071
to
a92fd22
Compare
a92fd22
to
5d15eb2
Compare
@adr1anh @storojs72 if you're happy with the extension trait, we can just stamp, otherwise I'll remove the latest commit. |
Summary
This is mostly implemented as a proof-of-concept to align with @adr1anh on #223. The RLC implements Horner's scheme on any iterator operand with the correct
MulAssign
,AddAssign
traits.Details
rlc
, which implements Horner's scheme,Borrow
,MulAssign
, andAddAssign
to define it, which exist onUniPoly
,rlc
function inevaluate
method andkzg_compute_batch_polynomial
,mlkzg.rs
file to directly handle vector arguments, simplifying the overall operations.kzg_verify_batch
closure and redundant inner function inkzg_compute_batch_polynomial
.Next steps