Assorted code related to cryptographic protocols