Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Convert large params to small without copying out of Arc's #11

Open
DrPeterVanNostrand opened this issue Aug 5, 2020 · 0 comments
Open

Comments

@DrPeterVanNostrand
Copy link

DrPeterVanNostrand commented Aug 5, 2020

Allow direct conversion of MPCParameters into MPCSmall without copying large vectors. Something like the following (this almost certainly doesn't compile):

impl From<MPCParameters> for MPCSmall {
    fn from(large: MPCParameters) -> Self {
        let MPCParameters {
            params: Parameters {
                vk: VerifyingKey {
                    delta_g1,
                    delta_g2,
                    ..
                },
                h,
                l,
                ..
            },
            cs_hash,
            contributions,
         } = large;
        
        let h = h.try_unwrap().unwrap();
        let l = l.try_unwrap().unwrap();
        
        MPCSmall {
            delta_g1,
            delta_g2,
            h,
            l,
            cs_hash,
            contributions,
        }
    }
}
@DrPeterVanNostrand DrPeterVanNostrand self-assigned this Aug 5, 2020
@DrPeterVanNostrand DrPeterVanNostrand changed the title Convert large params to small without copying out to Arc's Convert large params to small without copying out of Arc's Aug 14, 2020
@DrPeterVanNostrand DrPeterVanNostrand removed their assignment Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant