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