fetching and adding hmac to the packet