const uint8_t *key, void *val);
void *dimap_search(const di_digest256_map_t *map, const uint8_t *key,
void *dflt_val);
-int select_array_member_cumulative_timei(const uint64_t *entries, int n_entries,
+int select_array_member_cumulative_timei(const uint64_t *entries,
+ int n_entries,
uint64_t total, uint64_t rand_val);
#endif
* unsigned priority);
* int T_unsubscribe(const T_subscriber_t *)
*
- * Elsewhere you can say DECLARE_NOTIFY_PUBSUB_TOPIC(static, T), which declares:
+ * Elsewhere you can say DECLARE_NOTIFY_PUBSUB_TOPIC(static, T), which
+ * declares:
+ *
* static int T_notify(T_event_data_t *, unsigned notify_flags);
* static void T_clear(void);
*
#ifdef __GNUC__
#define IF_BUG_ONCE__(cond,var) \
- if (({ \
+ if (( { \
static int var = 0; \
int bool_result = (cond); \
if (PREDICT_UNLIKELY(bool_result) && !var) { \
var = 1; \
tor_bug_occurred_(SHORT_FILE__, __LINE__, __func__, #cond, 1); \
} \
- PREDICT_UNLIKELY(bool_result); }))
+ PREDICT_UNLIKELY(bool_result); } ))
#else
#define IF_BUG_ONCE__(cond,var) \
static int var = 0; \
/* Fill in the rend_data field so we can start doing a connection to
* a hidden service. */
rend_data_t *rend_data = ENTRY_TO_EDGE_CONN(conn)->rend_data =
- rend_data_client_create(socks->address, NULL, (char *) cookie, auth_type);
+ rend_data_client_create(socks->address, NULL, (char *) cookie,
+ auth_type);
if (rend_data == NULL) {
return -1;
}
STATIC int choose_array_element_by_weight(const uint64_t *entries,
int n_entries);
STATIC void scale_array_elements_to_u64(uint64_t *entries_out,
- const double *entries_in, int n_entries,
+ const double *entries_in,
+ int n_entries,
uint64_t *total_out);
STATIC const routerstatus_t *router_pick_directory_server_impl(
dirinfo_type_t auth, int flags,
#define MAX_DURATION 30
#define N_DISABLE 5
-static struct timeval fire_at[N_TIMERS] = {{0,0}};
+static struct timeval fire_at[N_TIMERS] = { {0,0} };
static int is_disabled[N_TIMERS] = {0};
static int fired[N_TIMERS] = {0};
-static struct timeval difference[N_TIMERS] = {{0,0}};
+static struct timeval difference[N_TIMERS] = { {0,0} };
static tor_timer_t *timers[N_TIMERS] = {NULL};
static int n_active_timers = 0;
timers_shutdown();
return ret;
}
+
char plaintext[16*4];
base16_decode(key, sizeof(key), key16, strlen(key16));
base16_decode(iv, sizeof(iv), ctr16, strlen(ctr16));
- base16_decode(plaintext, sizeof(plaintext), plaintext16, strlen(plaintext16));
+ base16_decode(plaintext, sizeof(plaintext),
+ plaintext16, strlen(plaintext16));
crypto_cipher_t *c = crypto_cipher_new_with_iv(key, iv);
crypto_cipher_crypt_inplace(c, plaintext, sizeof(plaintext));
int i;
for (i = 0; names[i].n; ++i) {
tt_str_op(names[i].n, OP_EQ,crypto_digest_algorithm_get_name(names[i].a));
- tt_int_op(names[i].a, OP_EQ,crypto_digest_algorithm_parse_name(names[i].n));
+ tt_int_op(names[i].a,
+ OP_EQ,crypto_digest_algorithm_parse_name(names[i].n));
}
- tt_int_op(-1, OP_EQ, crypto_digest_algorithm_parse_name("TimeCubeHash-4444"));
+ tt_int_op(-1, OP_EQ,
+ crypto_digest_algorithm_parse_name("TimeCubeHash-4444"));
done:
;
}
tor_free(mem_op_hex_tmp);
}
-
static void
test_crypto_curve25519_impl(void *arg)
{