A Rewriting Strategy for Protocol Verification