Nikos Mavrogiannopoulos nmav@gnutls.org writes:
I've now have nettle-mini for both master and 2.7. The patches required for master are gmp-mini branch and for 2.7 in nettle-2.7-mini-gmp.
Nice!
I'd appreciate if these go upstream as I've failed to add nettle to openwrt (and don't have to time to pursue that further), so I no longer plan to maintain these patches separately (and they will be easily break on makefile changes).
I'd really like to add mini-gmp support on the master branch, but I think it has to wait until after the release. I see one issue which your code, which I'd like to fix before integration, and that is that I think it is a bit too brittle to link the test programs with the real gmp. Problem is that mpz_t defined by gmp and mini-gmp is not really compatible.
It's possible to use mini-gmp and gmp in the same executable, since the symbol names seen by the linker are different, but then each compilation unit should use either gmp or mini-gmp, and no mpz_t variables can be passed across this boundary. The mini-gmp testsuite does this, converting numbers to hex strings when they need to be passed between gmp and mini-gmp functions.
For the nettle testsuite, I hope one can get by with something simpler. Do as many of the tests as possible using mini-gmp only, and disable tests which depend on functions only available in the real gmp library, e.g., mpz_urandomb.
Regards, /Niels