Based on former commit from Pavel Tvrdik
Add generic interface for generating and verifying MACs (message authentication codes). Replace multiple HMAC implementation with a generic one.