commit 05b35b44d9de5b5c535d3e46652734c048674d48 parent 0918a216074d31dbce3e743e29b491abea66153e Author: Elias Summermatter <elias.summermatter@seccom.ch> Date: Thu, 21 Jan 2021 16:28:54 +0100 Fixed some more stuff Diffstat:
| M | draft-summermatter-set-union.xml | | | 18 | ++++++++++++++---- |
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/draft-summermatter-set-union.xml b/draft-summermatter-set-union.xml @@ -1166,14 +1166,24 @@ hashSum | 0x0101 | 0x0101 | 0x5050 | 0000 | Its important that the elements can be redistributed over the buckets in case the IBF does not decode, that's why the ID is salted with a random salt given in the SALT field of this message. Salting is done by calculation the a random salt modulo 64 (using only the lowest 6-bits of the salt) - and do a bitwise right rotation of output of KDF by the 6-bit salts numeric representation. + and do a bitwise right rotation of output of KDF by the 6-bit salts numeric representation. To + get the IDSUM field all IDs who hit a bucket are added up with a binary XOR operation. </t> <t> The HASH is calculated by calculating the CRC32 checksum of the 64-bit ID value - which returns a 32-bit value. This is calculated modulo the count of buckets to - ensure that it is a valid bucket index. Create a new 64-bit value by shifting the 32-bit - value left and setting the lower 32-bit.... + which returns a 32-bit value. To get the HASHSUM field all IDs are added + up with a binary XOR operation. + </t> + <t> + To decide in which buckets the ID and HASH have to be added up there is the following + algorithm used: The first index is simply the HASH modulo the IBF size. The second + index is calculated by creating a new 64-bit value by shifting the 32-bit + value left and setting the lower 32-bit to the number of indexes already processed. From the + resulting 64-bit value a CRC32 checksum is created the second index is now the modulo of the + CRC32 output this is repeated until the predefined amount indexes is generated. + In the case a index is hit twice, which would mean this bucket could not get pure again, + the second hit is just skipped and the next iteration is used as. <!-- @Christian: I dont have a clue how this is done... The code is very hard to read can you explain the salt_key function in gnunet-service-set_union.c file