Add generic interface for generating and verifying MACs (message authentication codes). Replace multiple HMAC implementation with a generic one.