diff options
Diffstat (limited to 'toxcore/assoc.c')
-rw-r--r-- | toxcore/assoc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/assoc.c b/toxcore/assoc.c index 553f4339..44c4cc30 100644 --- a/toxcore/assoc.c +++ b/toxcore/assoc.c | |||
@@ -87,7 +87,7 @@ typedef struct candidates_bucket { | |||
87 | 87 | ||
88 | struct Assoc { | 88 | struct Assoc { |
89 | hash_t self_hash; /* hash of self_client_id */ | 89 | hash_t self_hash; /* hash of self_client_id */ |
90 | uint8_t self_client_id[CLIENT_ID_SIZE]; /* don't store entries for this */ | 90 | uint8_t self_client_id[crypto_box_PUBLICKEYBYTES]; /* don't store entries for this */ |
91 | 91 | ||
92 | /* association centralization: clients not in use */ | 92 | /* association centralization: clients not in use */ |
93 | size_t candidates_bucket_bits; | 93 | size_t candidates_bucket_bits; |
@@ -101,7 +101,7 @@ struct Assoc { | |||
101 | /* HELPER FUNCTIONS */ | 101 | /* HELPER FUNCTIONS */ |
102 | /*****************************************************************************/ | 102 | /*****************************************************************************/ |
103 | 103 | ||
104 | /* the complete distance would be CLIENT_ID_SIZE long... | 104 | /* the complete distance would be crypto_box_PUBLICKEYBYTES long... |
105 | * returns DISTANCE_INDEX_DISTANCE_BITS valid bits */ | 105 | * returns DISTANCE_INDEX_DISTANCE_BITS valid bits */ |
106 | static uint64_t id_distance(const Assoc *assoc, void *callback_data, const uint8_t *id_ref, const uint8_t *id_test) | 106 | static uint64_t id_distance(const Assoc *assoc, void *callback_data, const uint8_t *id_ref, const uint8_t *id_test) |
107 | { | 107 | { |
@@ -200,7 +200,7 @@ static hash_t id_hash(const Assoc *assoc, const uint8_t *id) | |||
200 | { | 200 | { |
201 | uint32_t i, res = 0x19a64e82; | 201 | uint32_t i, res = 0x19a64e82; |
202 | 202 | ||
203 | for (i = 0; i < CLIENT_ID_SIZE; i++) | 203 | for (i = 0; i < crypto_box_PUBLICKEYBYTES; i++) |
204 | res = ((res << 1) ^ id[i]) + (res >> 31); | 204 | res = ((res << 1) ^ id[i]) + (res >> 31); |
205 | 205 | ||
206 | /* can't have zero as hash, a) marks an unused spot, | 206 | /* can't have zero as hash, a) marks an unused spot, |
@@ -976,11 +976,11 @@ void kill_Assoc(Assoc *assoc) | |||
976 | 976 | ||
977 | #ifdef LOGGING | 977 | #ifdef LOGGING |
978 | 978 | ||
979 | static char buffer[CLIENT_ID_SIZE * 2 + 1]; | 979 | static char buffer[crypto_box_PUBLICKEYBYTES * 2 + 1]; |
980 | static char *idpart2str(uint8_t *id, size_t len) | 980 | static char *idpart2str(uint8_t *id, size_t len) |
981 | { | 981 | { |
982 | if (len > CLIENT_ID_SIZE) | 982 | if (len > crypto_box_PUBLICKEYBYTES) |
983 | len = CLIENT_ID_SIZE; | 983 | len = crypto_box_PUBLICKEYBYTES; |
984 | 984 | ||
985 | size_t i; | 985 | size_t i; |
986 | 986 | ||