Wrote tests for key_exchange