aicis/fresco

Efficient BigInteger alternative for modular arithmetic

Closed this issue · 5 comments

For #316 we would like to implement a more efficient alternative to the BigInteger class when doing modular arithmetic.

We should consider an approach based on pseudo mersennes or Montegomery reduction or similar approaches.

We should also consider a mutable approach.

Any benchmark results to share? :)

@mortendahl I do not have any concrete numbers. Last I heard from @pffrandsen who worked on this, using the the pseudo Mersenne prime approach saved something like 20% time when doing modular reductions compared to the generic method used in Java's BigInteger. However, the current implementation is not very heavily optimized, so there should be room for improvement over this.

Excellent, thanks!

Thanks for the details @pffrandsen, looking forward to further results! Will keep an eye on the repo but also happy to receive updates via mortendahlcs@gmail.com. Thank you.