mopro icon indicating copy to clipboard operation
mopro copied to clipboard

Support 254-bit inputs/outputs

Open vivianjeng opened this issue 1 year ago • 0 comments

Problem

Now the generate_proof in mopro-ffi doesn't support 254-bit inputs/outputs (which is the snark scalar field in bn254)

https://github.com/oskarth/mopro/blob/018bb1e3075d6f75f5e8edf0037bceff3f62bfbf/mopro-ffi/src/lib.rs#L66-L69

Notes

The acceptable types are listed here: https://mozilla.github.io/uniffi-rs/udl/builtin_types.html We can change the serialize_inputs

pub fn serialize_inputs(inputs: &SerializableInputs) -> Vec<Vec<u8>> 

and the generate_proof in mopro-ffi

    pub fn generate_proof(
        &self,
        inputs: HashMap<String, Vec<Vec<u8>>>,
    ) -> Result<GenerateProofResult, MoproError> 

(or other uint type e.g. u64)

Acceptance criteria

  • It should accept bigint like 21888242871839275222246405745257275088548364400416034343698204186575808495616
  • It should work with current tests
  • (There can be a test to input the bigint)

vivianjeng avatar Oct 25 '23 08:10 vivianjeng