Cryptoapi can be modular, so why not?Good job! Reduces the memory cost of having the capability "just in case" needed in small memory machines.
This patch does the following:
1. Change Kconfig option CRYPTO to tristate
2. Add __exit functions to crypto/api.c and crypto/proc.c
3. Change crypto/api.c:init_crypto() from void to int
4. Change crypto/Makefile to link hmac.o as part of the new crypto.ko module. hmac.c could be compiled as a seperate module, if not for the fact,
that sizeof(struct digest_tfm) depends on CONFIG_CRYPTO_HMAC.
Linking them together ensures that there is no mismatch. If the user
compiles crypto.ko without HMAC, and then compiles another module
with HMAC, (for example ah4.ko), it will correctly fail with
"ah4: Unknown symbol crypto_hmac_init".
When CONFIG_CRYPTO=y the code generated should be identical,
apart from point 3. above. When CONFIG_CRYPTO=m size of crypto/crypto.ko is 15k.
The patch is against 2.6.10-rc1-mm1, applies cleanly to 2.6.10-rc1 and
to 2.6.7 with two offsets.