Improve crypto_util coverage

This PR includes commits from #126.
As agreed on IRC, I am going to remove this (confusingly implemented) functionality for now.