Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
This repository was 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

@DrPeterVanNostrand

Description

@DrPeterVanNostrand

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,
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions