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.
source share