From: Zooko O'Whielacronx Date: Mon, 13 Jul 2009 00:13:20 +0000 (-0700) Subject: dirnode: finish renaming "iv" to "salt" in the code and the hash tag X-Git-Tag: trac-4000~14 X-Git-Url: https://git.rkrishnan.org/pf/content/en/frontends/cyclelanguage?a=commitdiff_plain;h=2f704ed0013ee5b08af0e8c005ef5af1ae7ab946;p=tahoe-lafs%2Ftahoe-lafs.git dirnode: finish renaming "iv" to "salt" in the code and the hash tag --- diff --git a/src/allmydata/dirnode.py b/src/allmydata/dirnode.py index d181cd7f..83a96ece 100644 --- a/src/allmydata/dirnode.py +++ b/src/allmydata/dirnode.py @@ -195,7 +195,7 @@ class NewDirectoryNode: def _encrypt_rwcap(self, rwcap): assert isinstance(rwcap, str) - salt = hashutil.mutable_rwcap_iv_hash(rwcap) + salt = hashutil.mutable_rwcap_salt_hash(rwcap) key = hashutil.mutable_rwcap_key_hash(salt, self._node.get_writekey()) cryptor = AES(key) crypttext = cryptor.process(rwcap) diff --git a/src/allmydata/util/hashutil.py b/src/allmydata/util/hashutil.py index 8987d2dc..883f27c6 100644 --- a/src/allmydata/util/hashutil.py +++ b/src/allmydata/util/hashutil.py @@ -82,7 +82,7 @@ MUTABLE_STORAGEINDEX_TAG = "allmydata_mutable_readkey_to_storage_index_v1" # dirnodes DIRNODE_CHILD_WRITECAP_TAG = "allmydata_mutable_writekey_and_salt_to_dirnode_child_capkey_v1" -DIRNODE_CHILD_IV_TAG = "allmydata_mutable_writekey_to_iv_v1" +DIRNODE_CHILD_SALT_TAG = "allmydata_dirnode_child_rwcap_to_salt_v1" def storage_index_hash(key): # storage index is truncated to 128 bits (16 bytes). We're only hashing a @@ -172,8 +172,8 @@ def hmac(tag, data): def mutable_rwcap_key_hash(iv, writekey): return tagged_pair_hash(DIRNODE_CHILD_WRITECAP_TAG, iv, writekey, KEYLEN) -def mutable_rwcap_iv_hash(writekey): - return tagged_hash(DIRNODE_CHILD_IV_TAG, writekey, IVLEN) +def mutable_rwcap_salt_hash(writekey): + return tagged_hash(DIRNODE_CHILD_SALT_TAG, writekey, IVLEN) def ssk_writekey_hash(privkey): return tagged_hash(MUTABLE_WRITEKEY_TAG, privkey, KEYLEN)