Skip to content
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

Use VariableBaseMSM to optimize decryption #54

Open
Tracked by #28
ggkitsas opened this issue Aug 3, 2021 · 1 comment
Open
Tracked by #28

Use VariableBaseMSM to optimize decryption #54

ggkitsas opened this issue Aug 3, 2021 · 1 comment

Comments

@ggkitsas
Copy link
Contributor

ggkitsas commented Aug 3, 2021

Loop in https://github.com/anoma/ferveo/blob/master/tpke/src/decryption.rs#L67 can be sped up by using arkworks VariableBaseMSM.

The code below shows an initial approach (currently failing with errors):

        use ark_ec::msm::VariableBaseMSM;
        // sum_D_j = { [\sum_j \alpha_{i,j} ] D_i }
        for (D, alpha_j, sum_alpha_D_i) in izip!(shares.iter(), alpha_ij.iter(), sum_D_j.iter_mut())
        {
            let Dj = D.iter().map(|Dij| Dij.decryption_share).collect::<Vec<_>>();
            let alpha_j = alpha_j.iter().map(|a| a.into_repr()).collect::<Vec<_>>();
            *sum_alpha_D_i = VariableBaseMSM::multi_scalar_mul(&Dj, &alpha_j);
        }
@ggkitsas ggkitsas added the TPKE label Aug 3, 2021
ggkitsas added a commit that referenced this issue Aug 10, 2021
@ghost
Copy link

ghost commented Apr 5, 2022

It seems there is potential to speed up MSM further, also; see:
https://github.com/Manta-Network/wasm-zkp-challenge/blob/optimized_pippenger/src/pippenger_msm.rs
(above is GPL licensed)

@ghost ghost added the prio:high label Apr 15, 2022
cygnusv pushed a commit to cygnusv/ferveo that referenced this issue Jul 28, 2023
Begin fixing TODO's in codebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant