shs_async

Crates.ioshs_async
lib.rsshs_async
version0.3.0
sourcesrc
created_at2019-03-06 04:02:12.952182
updated_at2019-05-03 03:12:02.57796
descriptionSecret-handshake protocol (async)
homepage
repositoryhttps://github.com/sunrise-choir/shs_async
max_upload_size
id119049
size49,057
all (github:sunrise-choir:all)

documentation

https://docs.rs/shs_async/

README

shs_async

Async secret-handshake protocol (for Secure Scuttlebutt (SSB)).


#![feature(async_await, await_macro, futures_api)]

use shs_async::*;

let stream = some_asyncread_asyncwrite_stream();

let net_id = NetworkId::SSB_MAIN_NET;
let (pk, sk) = server::generate_longterm_keypair();

let outcome = await!(server(stream, net_id, pk, sk));

// `outcome` is:
// pub struct HandshakeOutcome {
//   pub c2s_key:      ClientToServerKey,
//   pub s2c_key:      ServerToClientKey,
//   pub c2s_noncegen: ClientToServerNonceGen,
//   pub s2c_noncegen: ServerToClientNonceGen,
// }


let outcome = await!(client(stream, net_id, pk, sk, server_pk));

Commit count: 9

cargo fmt