mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-22 21:50:18 +00:00
Compare commits
3 Commits
b0d5de5853
...
01a91ccd6c
Author | SHA1 | Date | |
---|---|---|---|
|
01a91ccd6c | ||
|
9a20a3929a | ||
|
fe054fd03c |
@ -213,7 +213,7 @@ class Identity:
|
||||
Get a SHA-256 hash of passed data.
|
||||
|
||||
:param data: Data to be hashed as *bytes*.
|
||||
:returns: SHA-256 hash as *bytes*
|
||||
:returns: SHA-256 hash as *bytes*.
|
||||
"""
|
||||
return RNS.Cryptography.sha256(data)
|
||||
|
||||
@ -223,7 +223,7 @@ class Identity:
|
||||
Get a truncated SHA-256 hash of passed data.
|
||||
|
||||
:param data: Data to be hashed as *bytes*.
|
||||
:returns: Truncated SHA-256 hash as *bytes*
|
||||
:returns: Truncated SHA-256 hash as *bytes*.
|
||||
"""
|
||||
return Identity.full_hash(data)[:(Identity.TRUNCATED_HASHLENGTH//8)]
|
||||
|
||||
@ -233,10 +233,24 @@ class Identity:
|
||||
Get a random SHA-256 hash.
|
||||
|
||||
:param data: Data to be hashed as *bytes*.
|
||||
:returns: Truncated SHA-256 hash of random data as *bytes*
|
||||
:returns: Truncated SHA-256 hash of random data as *bytes*.
|
||||
"""
|
||||
return Identity.truncated_hash(os.urandom(Identity.TRUNCATED_HASHLENGTH//8))
|
||||
|
||||
@staticmethod
|
||||
def current_ratchet_id(destination_hash):
|
||||
"""
|
||||
Get the ID of the currently used ratchet key for a given destination hash
|
||||
|
||||
:param destination_hash: A destination hash as *bytes*.
|
||||
:returns: A ratchet ID as *bytes* or *None*.
|
||||
"""
|
||||
ratchet = Identity.get_ratchet(destination_hash)
|
||||
if ratchet == None:
|
||||
return None
|
||||
else:
|
||||
return Identity.truncated_hash(ratchet)
|
||||
|
||||
@staticmethod
|
||||
def _ratchet_public_bytes(ratchet):
|
||||
return X25519PrivateKey.from_private_bytes(ratchet).public_key().public_bytes()
|
||||
|
@ -1709,6 +1709,7 @@ class Transport:
|
||||
except Exception as e:
|
||||
RNS.log("Error while processing external announce callback.", RNS.LOG_ERROR)
|
||||
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||
RNS.trace_exception(e)
|
||||
|
||||
# Handling for link requests to local destinations
|
||||
elif packet.packet_type == RNS.Packet.LINKREQUEST:
|
||||
|
@ -131,7 +131,7 @@ class ROM():
|
||||
PRODUCT_RAK4631 = 0x10
|
||||
MODEL_11 = 0x11
|
||||
MODEL_12 = 0x12
|
||||
PRODUCT_TECHO = 0x43
|
||||
PRODUCT_TECHO = 0x15
|
||||
|
||||
PRODUCT_RNODE = 0x03
|
||||
MODEL_A1 = 0xA1
|
||||
@ -236,7 +236,7 @@ mcus = {
|
||||
models = {
|
||||
0x11: [430000000, 510000000, 22, "430 - 510 MHz", "rnode_firmware_rak4631.zip", "SX1262"],
|
||||
0x12: [779000000, 928000000, 22, "779 - 928 MHz", "rnode_firmware_rak4631.zip", "SX1262"],
|
||||
0x43: [779000000, 928000000, 22, "779 - 928 Mhz", "rnode_firmware_techo.zip", "SX1262"],
|
||||
0x15: [779000000, 928000000, 22, "779 - 928 Mhz", "rnode_firmware_techo.zip", "SX1262"],
|
||||
0xA4: [410000000, 525000000, 14, "410 - 525 MHz", "rnode_firmware.hex", "SX1278"],
|
||||
0xA9: [820000000, 1020000000, 17, "820 - 1020 MHz", "rnode_firmware.hex", "SX1276"],
|
||||
0xA1: [410000000, 525000000, 22, "410 - 525 MHz", "rnode_firmware_t3s3.zip", "SX1268"],
|
||||
|
Loading…
Reference in New Issue
Block a user