30 #ifndef __ZMQ_CURVE_CLIENT_HPP_INCLUDED__ 31 #define __ZMQ_CURVE_CLIENT_HPP_INCLUDED__ 35 #include "platform.hpp" 37 #if defined (ZMQ_USE_TWEETNACL) 39 #elif defined (ZMQ_USE_LIBSODIUM) 43 #if crypto_box_NONCEBYTES != 24 \ 44 || crypto_box_PUBLICKEYBYTES != 32 \ 45 || crypto_box_SECRETKEYBYTES != 32 \ 46 || crypto_box_ZEROBYTES != 32 \ 47 || crypto_box_BOXZEROBYTES != 16 48 # error "CURVE library not built properly" 60 class curve_client_t :
public mechanism_t
64 curve_client_t (
const options_t &options_);
65 virtual ~curve_client_t ();
68 virtual int next_handshake_command (msg_t *msg_);
69 virtual int process_handshake_command (msg_t *msg_);
70 virtual int encode (msg_t *msg_);
71 virtual int decode (msg_t *msg_);
72 virtual status_t status ()
const;
89 uint8_t public_key [crypto_box_PUBLICKEYBYTES];
92 uint8_t secret_key [crypto_box_SECRETKEYBYTES];
95 uint8_t cn_public [crypto_box_PUBLICKEYBYTES];
98 uint8_t cn_secret [crypto_box_SECRETKEYBYTES];
101 uint8_t server_key [crypto_box_PUBLICKEYBYTES];
104 uint8_t cn_server [crypto_box_PUBLICKEYBYTES];
107 uint8_t cn_cookie [16 + 80];
110 uint8_t cn_precom [crypto_box_BEFORENMBYTES];
114 uint64_t cn_peer_nonce;
116 int produce_hello (msg_t *msg_);
117 int process_welcome (
const uint8_t *cmd_data,
size_t data_size);
118 int produce_initiate (msg_t *msg_);
119 int process_ready (
const uint8_t *cmd_data,
size_t data_size);
120 int process_error (
const uint8_t *cmd_data,
size_t data_size);