mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-23 01:08:53 +00:00
directories: make the IV for the writecaps in directory entries be computed from the secure hash of the writecap itself
This makes encoding of directory entries deterministic, and it is also a tad faster on Macbook Pro than getting a random IV with os.urandom(16).
This commit is contained in:
@ -195,7 +195,7 @@ class NewDirectoryNode:
|
||||
|
||||
def _encrypt_rwcap(self, rwcap):
|
||||
assert isinstance(rwcap, str)
|
||||
IV = os.urandom(16)
|
||||
IV = hashutil.mutable_rwcap_iv_hash(self._node.get_writekey())
|
||||
key = hashutil.mutable_rwcap_key_hash(IV, self._node.get_writekey())
|
||||
cryptor = AES(key)
|
||||
crypttext = cryptor.process(rwcap)
|
||||
|
Reference in New Issue
Block a user