def test_crypto_kx_seed_keypair(seed1, seed2): seeded = b.crypto_kx_seed_keypair(seed1) seeded_other = b.crypto_kx_seed_keypair(seed2) if seed1 != seed2: assert seeded != seeded_other else: assert seeded == seeded_other
def test_crypto_kx_session_keys(seed1, seed2): s_keys = b.crypto_kx_seed_keypair(seed1) c_keys = b.crypto_kx_seed_keypair(seed2) server_rx_key, server_tx_key = b.crypto_kx_server_session_keys( s_keys[0], s_keys[1], c_keys[0]) client_rx_key, client_tx_key = b.crypto_kx_client_session_keys( c_keys[0], c_keys[1], s_keys[0]) assert client_rx_key == server_tx_key assert server_rx_key == client_tx_key
def test_crypto_kx_session_keys(seed1, seed2): s_keys = b.crypto_kx_seed_keypair(seed1) c_keys = b.crypto_kx_seed_keypair(seed2) server_rx_key, server_tx_key = \ b.crypto_kx_server_session_keys(s_keys[0], s_keys[1], c_keys[0]) client_rx_key, client_tx_key = \ b.crypto_kx_client_session_keys(c_keys[0], c_keys[1], s_keys[0]) assert client_rx_key == server_tx_key assert server_rx_key == client_tx_key
def test_crypto_kx_seed_keypair_seed_too_small(seed): with pytest.raises(exc.TypeError): b.crypto_kx_seed_keypair(seed)