BSD Licensed Big Integer C lib with fast modpow

I am looking for a fast (especially p ^ n mod g operation, to be implemented with montgomery) large integer library. I know there is GMP, but GMP is an LGPL that does not meet my requirements.

I tried http://www.acme.com/software/bigint/ and tried to optimize modpow there. But to make sure that the data is stored with a base of 2 ^ 32, it is not so simple to make some optimizations in modpow.

I also tried the giant from http://www.perfsci.com/free-software.asp , but this library has incorrect memory management. It constantly crashes with some malloc / free problems. Maybe bignum from OpenSSL will do what I'm looking for? But I do not want to add the whole version of OpenSSL to my project. Could it be possible to extract a portion of bignum from OpenSSL?

Are there any suggestions?

PS lib should work on iPhone / iPad.

+4
source share
1 answer

Try searching in libtomcrypt. It should have some big whole implementation, which is probably small and efficient. There seems to be no official upstream, but the sb dropbear implementation uses it and you can find the source with dropbear.

+4
source

Source: https://habr.com/ru/post/1314813/


All Articles