Is there a math library for PRECISE and LARGE calculus?

Hi developers,

hope you’re all doing well. I’m in need for a math library, which can give me exact values when doing calculus like large number multiplications (math.pow(2,40), …), because I need to perform modular calculus, of which the exact result crucial is, for the cryptographic system im trying to implement.

It should support number multiplication and decimals aswell.

I hope I was clear.

P.S. Im implementing Diffie Hellman and El Gamal algorithms for a test encryption.

Libraries that can handle arbitrary-precision decimal numbers are quite uncommon, especially w.r.t Lua. There are plenty of Lua BigInt libraries floating around (here is one) that you could use which support multiplication, exponentiation and modulus, if that would help.

Chances are you’ll have to port an arbitrary-precision decimal library to Lua. Not terribly difficult if you know what you’re doing.

1 Like

Thank you for the advice, I’ll take a deeper look into it!