mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-10 15:30:44 -04:00
Truncate name_hash to 80 bits. Take all array slices from Identity.NAME_HASH_LENGTH constant.
This commit is contained in:
parent
0b98a9bff4
commit
cb55189e5c
4 changed files with 18 additions and 19 deletions
|
@ -1084,7 +1084,7 @@ class Transport:
|
|||
if (not any(packet.destination_hash == d.hash for d in Transport.destinations) and packet.hops < Transport.PATHFINDER_M+1):
|
||||
announce_emitted = Transport.announce_emitted(packet)
|
||||
|
||||
random_blob = packet.data[RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8:RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8+10]
|
||||
random_blob = packet.data[RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8:RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8+10]
|
||||
random_blobs = []
|
||||
if packet.destination_hash in Transport.destination_table:
|
||||
random_blobs = Transport.destination_table[packet.destination_hash][4]
|
||||
|
@ -2054,7 +2054,7 @@ class Transport:
|
|||
|
||||
@staticmethod
|
||||
def announce_emitted(packet):
|
||||
random_blob = packet.data[RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8:RNS.Identity.KEYSIZE//8+RNS.Identity.HASHLENGTH//8+10]
|
||||
random_blob = packet.data[RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8:RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8+10]
|
||||
announce_emitted = int.from_bytes(random_blob[5:10], "big")
|
||||
|
||||
return announce_emitted
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue