-
Notifications
You must be signed in to change notification settings - Fork 103
Conversation
thanks for merging arkworks-rs/algebra#301 One solution is to fix dependency to Github for every repo in this workspace. This is ugly. |
Let me try to find a way. The common solution I use is to point this new repo to, not the crates.io version, but the GitHub version, so we can examine the PR and likely merge it. Then, during the next version release (we will improve this part), it would be adjusted accordingly. |
(And although I would be very happy for Translucence to use the arkworks-rs main branch, during this time we are still making adjustment and having the engineers onboard, I have to say that maybe you would be interested in a fork of arkworks...) |
That sounds good to me. I can push a change for this |
Let me add a quick clarification: by "pointing to", I mean "patches". |
hmmm... turns out this is not easy. A curve repo depends on an alternative temp solution is to copy the WDYT? (This is none-work related, so it is definitely not a high priority anyway) |
I believe if you use the |
f57672f
to
d906717
Compare
Thanks! Yes this solved the issue, and CI is passing :-) One more question:
Where should I change the code for this? Or should we leave as it is (i.e., the default multiplication use non-GLV, the caller need to specify GLV to get the speed improvement) |
Also FYI: this branch has rebased based on #76 for consistency |
I think the right approach for this is to enable overriding |
Not sure about it. I can think of two solutions:
WDYT? |
Ah I meant do as follows. In |
@zhenfeizhang any updates on this? |
We might be able to push the updated code from Espresso's Jellyfish. It is under the MIT license. |
Sounds good, whatever's convenient. |
Ok. I implemented the suggested solution. The current PR is blocked by arkworks-rs/algebra#396 |
Jellyfish does not really have those code as it does not use R1CS. The code are here I will create a separate PR to for glv constraints |
I'll reply here before PR for the Bandersnatch gadget is created. |
Not sure that is necessary. We are proving over ZZ the following eq:
regardless the size of Suppose that both
which is
That is
which is
That means |
ed_on_bls12_381/src/curves/mod.rs
Outdated
@@ -47,7 +47,7 @@ pub type SWProjective = SWGroupProjective<JubjubParameters>; | |||
/// | |||
/// A = 52296097456646850916096512823759002727550416093741407922227928430486925478210 | |||
/// B = 48351165704696163914533707656614864561753505123260775585269522553028192119009 | |||
/// | |||
|
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.
/// |
// Here we need to implement a customized MSM algorithm, since we know that | ||
// the high bits of Fr are restricted to be small, i.e. ~ 128 bits. | ||
// This MSM will save us some 128 doublings. | ||
pub(crate) fn multi_scalar_mul( |
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.
could you provide a better name for this? What does this method do?
@zhenfeizhang is there a way to derive the GLV parameters at compile-time in Rust itself? |
Had to close this one because the target branch (master at my forked branch) is changed. |
Description
closes: #XXXX
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 explorerThis PR enables the GLV algorithm for bandersnatch curve. It improves group operations from 75 us to around 40 us on an AMD 5900x.
Additional todos:
GLVParameters
trait definition algebra#301 is approved and mergedcurrently GLV is not the default multiplication algorithm.Make it into the default algorithm(need help: I need a pointer to the code where I can overwrite the multiplicand)