libmp and libcrypto

Mark Murray mark at grondar.org
Thu Apr 8 00:50:20 PDT 2004


Kaarthik Sivakumar writes:
> I am trying to compile a program that requires libmp for bignum and
> other large numbers. The configure test for libmp fails though. The
> output from config.log is at the end of the mail. It seems like
> linking with libmp requires linking with libcrypto also, libmp has
> undefined reference to BN_mul, etc. Is this how it is intended? I have
> been led to believe that neither Solaris' libmp or libgmp require it
> like this and usually it is the other way around, ie libcrypto would
> require libmp. So can anyone confirm that libcrypto is indeed needed
> for libmp?

Confirmed. Our libmp is a wrapper round the BIGNUM functions in libcrypto.

> libmp also defines a function called min() that takes one argument.
> The prototype for this function is in mp.h and this function takes one
> argument. This causes redefinition errors when compiling, since most
> programs seem to define a min() macro that takes 2 args and returns
> the minimum value. Would it possible to work around this in some way?
> Even better would be if the libmp functions had a mp_ prefix, like
> Solaris does. Is that something being considered? 

The mp.h header documents an ancient and sacred interface to the Berkeley
BIGNUM library. It ain't changing in a hurry. :-)

M
--
Mark Murray
iumop ap!sdn w,I idlaH


More information about the freebsd-current mailing list