Browse Source

iwym: pearson.h

pull/1119/head
Hamish Coleman 1 year ago
parent
commit
15ad901b41
  1. 6
      include/pearson.h
  2. 1
      src/edge.c
  3. 3
      src/edge_utils.c
  4. 3
      src/header_encryption.c
  5. 5
      src/management.c
  6. 1
      src/pearson.c
  7. 5
      src/sn_utils.c
  8. 5
      src/supernode.c
  9. 3
      src/transform_aes.c
  10. 3
      src/transform_cc20.c
  11. 4
      src/transform_speck.c
  12. 3
      src/transform_tf.c
  13. 3
      tools/n2n-benchmark.c
  14. 3
      tools/tests-hashing.c

6
include/pearson.h

@ -17,10 +17,8 @@
*/
#include <stddef.h>
#include <stdint.h>
#include "portable_endian.h"
#include <stddef.h> // for size_t
#include <stdint.h> // for uint8_t, uint16_t, uint32_t, uint64_t
void pearson_hash_256 (uint8_t *out, const uint8_t *in, size_t len);

1
src/edge.c

@ -18,6 +18,7 @@
#include "auth.h" // for generate_private_key, generate_p...
#include "n2n.h"
#include "pearson.h" // for pearson_hash_64
/* *************************************************** */

3
src/edge_utils.c

@ -18,7 +18,8 @@
#include "auth.h" // for generate_private_key
#include "header_encryption.h" // for packet_header_encrypt, packet_he...
#include "n2n.h"
#include "n2n.h" // for n2n_edge_t, peer_info, n2n_edge_...
#include "pearson.h" // for pearson_hash_128, pearson_hash_64
#include "network_traffic_filter.h"
#include "edge_utils_win32.h"

3
src/header_encryption.c

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

5
src/management.c

@ -9,6 +9,9 @@
#include <netdb.h>
#endif
#include <pearson.h> // for pearson_hash_64
#include "n2n.h" // for TRACE_DEBUG, traceEvent
// TODO: move logging defs in their own header and include that
void setTraceLevel (int level);
int getTraceLevel ();
@ -16,8 +19,6 @@ int getTraceLevel ();
#include <pearson.h>
#include "management.h"
#include "n2n.h" // for traceEvent and friends
ssize_t send_reply (mgmt_req_t *req, strbuf_t *buf, size_t msg_len) {
// TODO: better error handling (counters?)
return sendto(req->mgmt_sock, buf->str, msg_len, 0,

1
src/pearson.c

@ -22,6 +22,7 @@
#include "pearson.h"
#include "portable_endian.h" // for le64toh, htobe64
// Christopher Wellons' triple32 from https://github.com/skeeto/hash-prospector

5
src/sn_utils.c

@ -16,9 +16,12 @@
*
*/
#include "auth.h" // for ascii_to_bin, calculate_dynamic_key
#include "header_encryption.h" // for packet_header_encrypt, packet_header_...
#include "n2n.h"
#include "n2n.h" // for sn_community, n2n_sn_t, peer_info
#include "pearson.h" // for pearson_hash_128, pearson_hash_32
#define HASH_FIND_COMMUNITY(head, name, out) HASH_FIND_STR(head, name, out)

5
src/supernode.c

@ -18,7 +18,10 @@
/* Supernode for n2n-2.x */
#include "n2n.h"
#include "n2n.h" // for n2n_sn_t, sn_community, traceEvent
#include "pearson.h" // for pearson_hash_64
#define HASH_FIND_COMMUNITY(head, name, out) HASH_FIND_STR(head, name, out)

3
src/transform_aes.c

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

3
src/transform_cc20.c

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

4
src/transform_speck.c

@ -17,8 +17,8 @@
*/
#include "n2n.h"
#include "n2n.h" // for n2n_trans_op_t, traceEvent, TRACE_DEBUG
#include "pearson.h" // for pearson_hash_256
// Speck plaintext preamble
#define TRANSOP_SPECK_PREAMBLE_SIZE (N2N_SPECK_IVEC_SIZE)

3
src/transform_tf.c

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

3
tools/n2n-benchmark.c

@ -22,7 +22,8 @@
#include <sys/time.h>
#endif
#include "n2n.h"
#include "n2n.h" // for n2n_trans_op_t, n2n_common_t, n2n_edge_conf_t
#include "pearson.h" // for pearson_hash_64, pearson_hash_init
#define DURATION 2.5 // test duration per algorithm
#define PACKETS_BEFORE_GETTIME 2047 // do not check time after every packet but after (2 ^ n - 1)

3
tools/tests-hashing.c

@ -19,7 +19,8 @@
#include <inttypes.h>
#include "n2n.h"
#include "hexdump.h"
#include "hexdump.h" // for fhexdump
#include "pearson.h" // for pearson_hash_128, pearson_hash_16, pearson_has...
uint8_t PKT_CONTENT[]={

Loading…
Cancel
Save