Jeronimo Pellegrini pellegrini@mpcnet.com.br writes:
But rsa.h includes gmp.h, and unfortunately, this won't work for C++ (at least not for g++) -- not even if declared 'extern "C"'. The <gmpxx.h> header should be used when using GMP from C++ programs.
That sounds kind of broken. The way I understand it, to use the C++ interface to GMP, you should include gmpxx.h, but if you want to use the plain old C interface from within a C++ program, then you should be able to use gmp.h from C++ programs.
What error messages do you get? This really sounds like a bug in gmp or in the gmp installation.
It would be nice if we could call Nettle's rsa.h from C++. It would work with an #if:
The intention is that
extern "C" { #include <nettle/rsa.h> }
should just work. If it doesn't, that's a bug in nettle or gmp or both.
If there is interest, I could make a patch with either of these two solutions.
First, please investigate why including gmp.h fails.
It has been suggested earlier that Nettle's include files should contain their own C++ guards. The main reason I haven't done that, is that I don't personally use C++, and I don't have any testcases for Nettle and C++. So test cases would be the first requirement for explicit C++ support in Nettle.
Regards, /Niels
PS. Sorry for the late reply, it's caused by a combination of computer problems and child birth ;-)