Added HMAC generation method.