Simon Josefsson jas@extundo.com writes:
A nit though, I see Nettle configure.ac says AX_CREATE_STDINT_H([nettle-types.h]), I think it is better to say AX_CREATE_STDINT_H(nettle-types.h, sys/types.h).
The version of AX_CREATE_STDINT_H I use contains code like
if test "_$ac_cv_header_stdint_x" = "_" ; then if test "_$ac_cv_header_stdint_o" = "_" ; then AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) AC_MSG_RESULT([(..)]) for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do
so it seems sys/types.h should be considered already. Do you know that it doesn't work?
A wishlist item as well: splitting up hmac.h into hmac.h, hmac-md5.h, hmac-sha.h would be useful. Then you don't have to copy code for sha if you only need md5, and vice versa.
Hmm, can you explain what's the problem with this "copying"? There are four different object files, hmac.o, hmac-md5.o, hmac-sha1.o and hmac-sha256.o, so with static linking, only the needed ones should be dragged into the executable.
I try to keep the number of header files down a little, for example sha1 and sha256 are both declared in sha.h, des and des3 are both in des.h, all rsa-related functions collected in rsa.h, etc. Do you see a problem with that design? (I'm not 100% consistent, in particular md4 are md5 are declared in separate header files).
One alternative that would almost work is to replace the `#include "md5.h"' in hmac.h with a forward declaration `struct md5;'. Then users of hmac-md5 would need to include both hmac.h and md5.h. I can't say if that would solve your problem, though, as I don't know what it is...
The reason a forward declaration won't work right away, is the hmac.h declaration
struct hmac_md5_ctx HMAC_CTX(struct md5_ctx);
which needs the storage size of struct md5_ctx to make sense.
BTW, there's one known bug in the nettle-1.8 distribution: A few of the header files are forgotten by the make install target. I'll wait some more for bug reports before making a bugfix release to address that.
Best regards, /Niels