test/crypto: move RSA enqueue/dequeue into functions