[noise] implementation public API

Jason A. Donenfeld Jason at zx2c4.com
Tue Sep 1 06:54:48 PDT 2015


I don't expect this to influence the design of Noise very much, but in case
it's useful to have, here's the "public" API that my Noise implementation
exposes to the rest of the codebase. The functions that consume messages
take a pointer to a structure elsewhere in my code, and return a pointer to
another structure.

bool noise_handshake_create_initiation(struct
noise_message_handshake_initiation *dst, struct noise_peer *peer, u16
self_index);struct wireguard_peer
*noise_handshake_consume_initiation(struct
noise_message_handshake_initiation *src, struct wireguard_device *wg);

bool noise_handshake_create_response(struct
noise_message_handshake_response *dst, struct noise_peer *peer, u16
self_index);struct wireguard_peer
*noise_handshake_consume_response(struct
noise_message_handshake_response *src, struct wireguard_device *wg);

bool noise_handshake_begin_session(struct noise_peer *peer, bool
i_am_the_initator);

bool noise_message_create_data(struct noise_message_data *dst, const
u8 *src, size_t src_len, struct noise_peer *peer);

struct wireguard_peer *noise_message_consume_data(u8 *dst, const
struct noise_message_data *src, size_t src_len, struct
wireguard_device *wg);

void noise_peer_init(struct noise_peer *peer, const u8
my_private_key[NOISE_PUBLIC_KEY_LEN], const u8
their_public_key[NOISE_PUBLIC_KEY_LEN]);void
noise_peer_set_private_key(struct noise_peer *peer, const u8
my_private_key[NOISE_PUBLIC_KEY_LEN]);void noise_peer_clear(struct
noise_peer *peer);

u8 noise_message_determine_type(void *src, size_t src_len);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://moderncrypto.org/mail-archive/noise/attachments/20150901/df50e94d/attachment.html>


More information about the Noise mailing list