示例#1
0
文件: test_kx.py 项目: tsrour/pynacl
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
示例#2
0
文件: test_kx.py 项目: lmctv/pynacl
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
示例#3
0
文件: test_kx.py 项目: tsrour/pynacl
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
示例#4
0
文件: test_kx.py 项目: lmctv/pynacl
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
示例#5
0
文件: test_kx.py 项目: tsrour/pynacl
def test_crypto_kx_seed_keypair_seed_too_small(seed):
    with pytest.raises(exc.TypeError):
        b.crypto_kx_seed_keypair(seed)
示例#6
0
文件: test_kx.py 项目: lmctv/pynacl
def test_crypto_kx_seed_keypair_seed_too_small(seed):
    with pytest.raises(exc.TypeError):
        b.crypto_kx_seed_keypair(seed)