Browse Source

iwyu: random_numbers.h

pull/1119/head
Hamish Coleman 1 year ago
parent
commit
f67cc8f2a6
  1. 9
      include/random_numbers.h
  2. 2
      src/edge.c
  3. 5
      src/edge_utils.c
  4. 5
      src/example_edge_embed_quick_edge_init.c
  5. 1
      src/header_encryption.c
  6. 3
      src/n2n.c
  7. 5
      src/random_numbers.c
  8. 1
      src/sn_utils.c
  9. 1
      src/transform_aes.c
  10. 1
      src/transform_cc20.c
  11. 1
      src/transform_speck.c
  12. 1
      src/transform_tf.c
  13. 1
      tools/n2n-portfwd.c
  14. 1
      tools/n2n-route.c

9
include/random_numbers.h

@ -21,21 +21,16 @@
#define RND_H #define RND_H
#include <stdint.h> #include <stdint.h> // for uint64_t, uint32_t
#include <stddef.h>
#include <time.h> /* time, clock */
#include "n2n.h" /* traceEvent */
// syscall and inquiring random number from hardware generators might fail, so we will retry // syscall and inquiring random number from hardware generators might fail, so we will retry
#define RND_RETRIES 1000 #define RND_RETRIES 1000
#if defined (__linux__) #if defined (__linux__)
#include <sys/syscall.h> /* syscall, SYS_getrandom */ #include <syscall.h> // for SYS_getrandom
#ifdef SYS_getrandom #ifdef SYS_getrandom
#define GRND_NONBLOCK 1 #define GRND_NONBLOCK 1
#include <errno.h> /* errno, EAGAIN */
#endif #endif
#endif #endif

2
src/edge.c

@ -19,6 +19,8 @@
#include "auth.h" // for generate_private_key, generate_p... #include "auth.h" // for generate_private_key, generate_p...
#include "n2n.h" #include "n2n.h"
#include "pearson.h" // for pearson_hash_64 #include "pearson.h" // for pearson_hash_64
#include "random_numbers.h" // for n2n_seed, n2n_srand
/* *************************************************** */ /* *************************************************** */

5
src/edge_utils.c

@ -17,11 +17,12 @@
*/ */
#include "auth.h" // for generate_private_key #include "auth.h" // for generate_private_key
#include "edge_utils_win32.h"
#include "header_encryption.h" // for packet_header_encrypt, packet_he... #include "header_encryption.h" // for packet_header_encrypt, packet_he...
#include "n2n.h" // for n2n_edge_t, peer_info, n2n_edge_... #include "n2n.h" // for n2n_edge_t, peer_info, n2n_edge_...
#include "network_traffic_filter.h" // for create_network_traffic_filter
#include "pearson.h" // for pearson_hash_128, pearson_hash_64 #include "pearson.h" // for pearson_hash_128, pearson_hash_64
#include "network_traffic_filter.h" #include "random_numbers.h" // for n2n_rand, n2n_rand_sqr
#include "edge_utils_win32.h"
/* ************************************** */ /* ************************************** */

5
src/example_edge_embed_quick_edge_init.c

@ -16,7 +16,10 @@
* *
*/ */
#include "n2n.h"
#include "n2n.h" // for quick_edge_init, setTraceLevel
#include "random_numbers.h" // for n2n_seed, n2n_srand
/* /*
This tool demonstrates how to easily embed This tool demonstrates how to easily embed

1
src/header_encryption.c

@ -20,6 +20,7 @@
#include "header_encryption.h" // for packet_header_change_dynamic_key, pac... #include "header_encryption.h" // for packet_header_change_dynamic_key, pac...
#include "n2n.h" // for he_context_t, N2N_COMMUNITY_SIZE, TRA... #include "n2n.h" // for he_context_t, N2N_COMMUNITY_SIZE, TRA...
#include "pearson.h" // for pearson_hash_128, pearson_hash_64 #include "pearson.h" // for pearson_hash_128, pearson_hash_64
#include "random_numbers.h" // for n2n_rand
#define HASH_FIND_COMMUNITY(head, name, out) HASH_FIND_STR(head, name, out) #define HASH_FIND_COMMUNITY(head, name, out) HASH_FIND_STR(head, name, out)

3
src/n2n.c

@ -18,7 +18,8 @@
#include "n2n.h" #include "n2n.h"
#include "sn_selection.h" #include "random_numbers.h" // for n2n_rand
#include "sn_selection.h" // for sn_selection_criterion_default
#include "minilzo.h" #include "minilzo.h"

5
src/random_numbers.c

@ -17,6 +17,11 @@
*/ */
#include <errno.h> // for errno, EAGAIN
#include <stddef.h> // for NULL, size_t
#include <time.h> // for clock, time
#include <unistd.h> // for syscall
#include "n2n.h" // for TRACE_ERROR, traceEvent
#include "random_numbers.h" #include "random_numbers.h"

1
src/sn_utils.c

@ -21,6 +21,7 @@
#include "header_encryption.h" // for packet_header_encrypt, packet_header_... #include "header_encryption.h" // for packet_header_encrypt, packet_header_...
#include "n2n.h" // for sn_community, n2n_sn_t, peer_info #include "n2n.h" // for sn_community, n2n_sn_t, peer_info
#include "pearson.h" // for pearson_hash_128, pearson_hash_32 #include "pearson.h" // for pearson_hash_128, pearson_hash_32
#include "random_numbers.h" // for n2n_rand, n2n_rand_sqr, n2n_seed, n2n...
#define HASH_FIND_COMMUNITY(head, name, out) HASH_FIND_STR(head, name, out) #define HASH_FIND_COMMUNITY(head, name, out) HASH_FIND_STR(head, name, out)

1
src/transform_aes.c

@ -19,6 +19,7 @@
#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR #include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR
#include "pearson.h" // for pearson_hash_256 #include "pearson.h" // for pearson_hash_256
#include "random_numbers.h" // for n2n_rand
// size of random value prepended to plaintext defaults to AES BLOCK_SIZE; // size of random value prepended to plaintext defaults to AES BLOCK_SIZE;

1
src/transform_cc20.c

@ -20,6 +20,7 @@
#include "cc20.h" // for CC20_IV_SIZE, cc20_crypt, cc20_deinit #include "cc20.h" // for CC20_IV_SIZE, cc20_crypt, cc20_deinit
#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR #include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR
#include "pearson.h" // for pearson_hash_256 #include "pearson.h" // for pearson_hash_256
#include "random_numbers.h" // for n2n_rand
// ChaCha20 plaintext preamble // ChaCha20 plaintext preamble

1
src/transform_speck.c

@ -19,6 +19,7 @@
#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_DEBUG #include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_DEBUG
#include "pearson.h" // for pearson_hash_256 #include "pearson.h" // for pearson_hash_256
#include "random_numbers.h" // for n2n_rand
// Speck plaintext preamble // Speck plaintext preamble
#define TRANSOP_SPECK_PREAMBLE_SIZE (N2N_SPECK_IVEC_SIZE) #define TRANSOP_SPECK_PREAMBLE_SIZE (N2N_SPECK_IVEC_SIZE)

1
src/transform_tf.c

@ -19,6 +19,7 @@
#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR #include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_ERROR
#include "pearson.h" // for pearson_hash_256 #include "pearson.h" // for pearson_hash_256
#include "random_numbers.h" // for n2n_rand
// size of random value prepended to plaintext defaults to TF_BLOCK_SIZE; // size of random value prepended to plaintext defaults to TF_BLOCK_SIZE;

1
tools/n2n-portfwd.c

@ -19,6 +19,7 @@
#include "json.h" // for _jsonpair, json_object_t, json_free #include "json.h" // for _jsonpair, json_object_t, json_free
#include "n2n.h" // for traceEvent, setTraceLevel, getTraceLevel #include "n2n.h" // for traceEvent, setTraceLevel, getTraceLevel
#include "random_numbers.h" // for n2n_rand, n2n_seed, n2n_srand
#define WITH_PORT 1 #define WITH_PORT 1

1
tools/n2n-route.c

@ -19,6 +19,7 @@
#include "json.h" // for _jsonpair, json_object_t, _jsonvalue #include "json.h" // for _jsonpair, json_object_t, _jsonvalue
#include "n2n.h" // for inaddrtoa, traceEvent, TRACE_WARNING #include "n2n.h" // for inaddrtoa, traceEvent, TRACE_WARNING
#include "random_numbers.h" // for n2n_rand, n2n_seed, n2n_srand
#if defined (__linux__) || defined(WIN32) /* currently, Linux and Windows only */ #if defined (__linux__) || defined(WIN32) /* currently, Linux and Windows only */

Loading…
Cancel
Save