Unrevert crypto test commits

This reverts commit 734fd28d36ab795a88477ffb57145f36ca013d81.
Fixed tests properly, using new repr format