Added unit tests for crypto, all pass