hmac256 function implemented. unused global variables removed