square / jna-gmp

A Java JNA wrapper around the GNU Multiple Precision Arithmetic Library.
Apache License 2.0
62 stars 24 forks source link

modInverse support #6

Closed wilko77 closed 8 years ago

wilko77 commented 8 years ago

We are using your library for implementing homomorphic encryption schemes. During benchmarking I realised that the 'modInverse' implementation of BigInteger is an order of magnitude slower than the GMP one. Therefore I extended your code to also offer access to the GMP implementation for computing a modular inverse. I believe this modifications could be useful to others trying to improve the runtime of their Java crypto implementations.

dragonsinth commented 8 years ago

Thanks so much for the patch. Looks mostly good at a glance, I'll load it up and run the tests.

dragonsinth commented 8 years ago

I cleaned this up a bit and pushed my work to: https://github.com/square/jna-gmp/pull/8

JakeWharton commented 8 years ago

This was merged with #8.