app/crypto-perf: refactor common test code