aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set_union.c
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-03-09 16:57:52 +0000
committerFlorian Dold <florian.dold@gmail.com>2016-03-09 16:57:52 +0000
commit165f050555ce4f06380cc26c1dc09235c7b135e6 (patch)
tree47987871ef1790e37a1b834dc12a9c3ca8004b7b /src/set/gnunet-service-set_union.c
parent99cfe33894a311ef45d5552248625615324ec628 (diff)
downloadgnunet-165f050555ce4f06380cc26c1dc09235c7b135e6.tar.gz
gnunet-165f050555ce4f06380cc26c1dc09235c7b135e6.zip
Fix ibf key salting.
Diffstat (limited to 'src/set/gnunet-service-set_union.c')
-rw-r--r--src/set/gnunet-service-set_union.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index 9010a99fd..aeb706ec3 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -18,7 +18,7 @@
18 Boston, MA 02110-1301, USA. 18 Boston, MA 02110-1301, USA.
19*/ 19*/
20/** 20/**
21 * @file set/gnunet-service-set_union.c msg->salt = htonl (op->state->salt_send); 21 * @file set/gnunet-service-set_union.c
22 22
23 * @brief two-peer set operations 23 * @brief two-peer set operations
24 * @author Florian Dold 24 * @author Florian Dold
@@ -454,6 +454,7 @@ salt_key (const struct IBF_Key *k_in,
454{ 454{
455 int s = salt % 64; 455 int s = salt % 64;
456 uint64_t x = k_in->key_val; 456 uint64_t x = k_in->key_val;
457 /* rotate ibf key */
457 x = (x >> s) | (x << (64 - s)); 458 x = (x >> s) | (x << (64 - s));
458 k_out->key_val = x; 459 k_out->key_val = x;
459} 460}
@@ -464,9 +465,9 @@ unsalt_key (const struct IBF_Key *k_in,
464 uint32_t salt, 465 uint32_t salt,
465 struct IBF_Key *k_out) 466 struct IBF_Key *k_out)
466{ 467{
467 int s = -(salt % 64); 468 int s = salt % 64;
468 uint64_t x = k_in->key_val; 469 uint64_t x = k_in->key_val;
469 x = (x >> s) | (x << (64 - s)); 470 x = (x << s) | (x >> (64 - s));
470 k_out->key_val = x; 471 k_out->key_val = x;
471} 472}
472 473
@@ -914,8 +915,7 @@ decode_and_send (struct Operation *op)
914 "# of IBF retries", 915 "# of IBF retries",
915 1, 916 1,
916 GNUNET_NO); 917 GNUNET_NO);
917 // FIXME: make salt work 918 op->state->salt_send++;
918 // op->state->salt_send++;
919 if (GNUNET_OK != 919 if (GNUNET_OK !=
920 send_ibf (op, next_order)) 920 send_ibf (op, next_order))
921 { 921 {