kopia lustrzana https://github.com/markqvist/reticulum
Allow IFAC bitmask generation for large packet sizes
rodzic
5d677d2fb7
commit
45494f21aa
|
@ -48,7 +48,7 @@ def hkdf(length=None, derive_from=None, salt=None, context=None):
|
||||||
derived = b""
|
derived = b""
|
||||||
|
|
||||||
for i in range(ceil(length / hash_len)):
|
for i in range(ceil(length / hash_len)):
|
||||||
block = hmac_sha256(pseudorandom_key, block + context + bytes([i + 1]))
|
block = hmac_sha256(pseudorandom_key, block + context + bytes([(i + 1)%(0xFF+1)]))
|
||||||
derived += block
|
derived += block
|
||||||
|
|
||||||
return derived[:length]
|
return derived[:length]
|
||||||
|
|
Ładowanie…
Reference in New Issue