15 #if !defined ZMQ_HAVE_WINDOWS
19 #if defined(ZMQ_USE_LIBSODIUM)
25 #if defined ZMQ_HAVE_WINDOWS
26 Sleep (seconds_ * 1000);
34 uint64_t *watch =
static_cast<uint64_t *
> (malloc (
sizeof (uint64_t)));
37 return static_cast<void *
> (watch);
43 const uint64_t
start = *
static_cast<uint64_t *
> (watch_);
44 return static_cast<unsigned long> (
end -
start);
58 thread->
start (func_, arg_,
"ZMQapp");
72 static char encoder[85 + 1] = {
"0123456789"
86 0xFF, 0x44, 0xFF, 0x54, 0x53, 0x52, 0x48, 0xFF, 0x4B, 0x4C, 0x46, 0x41,
87 0xFF, 0x3F, 0x3E, 0x45, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
88 0x08, 0x09, 0x40, 0xFF, 0x49, 0x42, 0x4A, 0x47, 0x51, 0x24, 0x25, 0x26,
89 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,
90 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x4D,
91 0xFF, 0x4E, 0x43, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
92 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C,
93 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x4F, 0xFF, 0x50, 0xFF, 0xFF};
103 if (size_ % 4 != 0) {
107 unsigned int char_nbr = 0;
108 unsigned int byte_nbr = 0;
110 while (byte_nbr < size_) {
113 if (byte_nbr % 4 == 0) {
115 unsigned int divisor = 85 * 85 * 85 * 85;
123 assert (char_nbr == size_ * 5 / 4);
137 unsigned int byte_nbr = 0;
138 unsigned int char_nbr = 0;
140 size_t src_len = strlen (string_);
142 if (src_len < 5 || src_len % 5 != 0)
145 while (string_[char_nbr]) {
152 const uint8_t
index = string_[char_nbr++] - 32;
163 if (char_nbr % 5 == 0) {
165 unsigned int divisor = 256 * 256 * 256;
173 if (char_nbr % 5 != 0) {
176 assert (byte_nbr == strlen (string_) * 4 / 5);
192 #if defined(ZMQ_HAVE_CURVE)
193 #if crypto_box_PUBLICKEYBYTES != 32 || crypto_box_SECRETKEYBYTES != 32
194 #error "CURVE encryption library not built correctly"
197 uint8_t public_key[32];
198 uint8_t secret_key[32];
202 const int res = crypto_box_keypair (public_key, secret_key);
210 (
void) z85_public_key_, (
void) z85_secret_key_;
224 #if defined(ZMQ_HAVE_CURVE)
225 #if crypto_box_PUBLICKEYBYTES != 32 || crypto_box_SECRETKEYBYTES != 32
226 #error "CURVE encryption library not built correctly"
229 uint8_t public_key[32];
230 uint8_t secret_key[32];
238 crypto_scalarmult_base (public_key, secret_key);
245 (
void) z85_public_key_, (
void) z85_secret_key_;