Fix HMAC for newer python versions