Machine-Level Software Optimization of Cryptographic Protocols