tiny-bignum-c icon indicating copy to clipboard operation
tiny-bignum-c copied to clipboard

export `pow_mod_fast` to the public

Open blackshirt opened this issue 4 years ago • 1 comments

I think its good to export pow_mod_faster in the tests/rsa.c to the public API in the form bignum_pow_mod function. Its complement bignum_pow but with fast modulo exponentiation functionality at the hand

blackshirt avatar Aug 26 '21 02:08 blackshirt

Hi @blackshirt and thanks for your interest in improving state of affairs :)

I agree that it could be a nice addition, but I also feel it's heavily slanted towards crypto over integer/prime-fields. And I don't think this library is a good fit for serious work in that area - the RSA code is mostly for fun and games.

Proper implementations should use hardware-acceleration and constant time primitives - and should definitely not use vanilla RSA, but add blinding or whatever to mitigate side-channel attacks.

Exporting pow_mod_faster is a sort of feature-creep that I would like to avoid unless there really is a demand for it ...

Someone contributed an implementation of karatsuba-multiplication, which I haven't come around to merge yet - for some of the same reasons...

kokke avatar Dec 21 '21 15:12 kokke