Make the crypto + digest + verification functions configurable.
Fixup the signature verification code a little.