nisse@lysator.liu.se (Niels Möller) writes:
I guess one solution is to add sha.h, but not sha*.c, so hmac.h works, but since I don't need SHA, it feels slightly confusing.
Any ideas appreciated. Of course, all this is very minor.
Perhaps it would make sense to add something like
#ifndef NETTLE_WANT_HMAC_SHA1 # define NETTLE_WANT_HMAC_SHA1 1 #endif
...
#if NETTLE_WANT_HMAC_SHA1 # include "sha.h" ... hmac-sha1-related stuff ... #endif
to hmac.h. Then you can just add -DNETTLE_WANT_HMAC_SHA1=0 to your CPPFLAGS. It will clutter up the header files a little, especially if it's done consistently for other header files that declares many related structures.
Yes. For what it's worth, I think the clutter makes the file unreadable, which I (objectively) think is worse than requiring me to include an unused sha.h in a package. Perhaps I can find some use of SHA in my package, so the file isn't unused... But if Nettle supported HMAC with many hashes (MD2, MD4, ...), I guess I would once again have the feeling that the current hmac.h approach doesn't scale.
Again, this is not that important.
Thanks, Simon