Inversed-Tech / eyelid

Private iris matching
Apache License 2.0
0 stars 0 forks source link

Use `u128` as the base integer for polynomial coefficients, rather than `[u64; 2]` #15

Open teor2345 opened 4 months ago

teor2345 commented 4 months ago

It might be faster to use u128 as the coefficient type, rather than [u64; 2].

But doesn't look like this will be easy, ark-ff is set up to assume u64 in a lot of places, and the trait hierarchy is very deep.

We might be able to fork ark-ff, and search and replace u64 with u128. Which seems like a lot of work, and it's not urgent.

teor2345 commented 4 months ago

Here's my first attempt at this, it seems like it will be really tricky.

I got stuck when trying to implement all the arithmetic traits: https://github.com/Inversed-Tech/eyelid/tree/poly-u128

This is because both std::u128 and ark_ff::Field are in other crates: https://github.com/Ixrec/rust-orphan-rules#what-are-the-orphan-rules

teor2345 commented 3 months ago

To do this, we might need to:

  1. fork ark-ff
  2. search and replace u64 with a type alias
  3. switch that type alias to u128
  4. halve our Fq size parameters