Formal specification and generation of verifiable binary parsers, message generators and protocol state machines