How does a device verify the integrity of a message?