Beispiel #1
0
def hydro_kx_session_keypair(tx_bytes, rx_bytes):
    assert len(tx_bytes) == h.hydro_kx_SESSIONKEYBYTES
    assert len(rx_bytes) == h.hydro_kx_SESSIONKEYBYTES
    session_pair = ffi.new('hydro_kx_session_keypair *')
    ffi.memmove(session_pair.tx, tx_bytes, h.hydro_kx_SESSIONKEYBYTES)
    ffi.memmove(session_pair.rx, rx_bytes, h.hydro_kx_SESSIONKEYBYTES)
    return session_pair
Beispiel #2
0
def hydro_kx_keypair(pk_bytes, sk_bytes):
    assert len(pk_bytes) == h.hydro_kx_PUBLICKEYBYTES
    assert len(sk_bytes) == h.hydro_kx_SECRETKEYBYTES
    pair = ffi.new('hydro_kx_keypair *')
    ffi.memmove(pair.pk, pk_bytes, h.hydro_kx_PUBLICKEYBYTES)
    ffi.memmove(pair.sk, sk_bytes, h.hydro_kx_SECRETKEYBYTES)
    return pair