sht.set_hashes(sh)
self._share_hash = sht.get_leaf(self.sharenum)
- blockhash = hashutil.tagged_hash("encoded subshare", blockdata)
+ #log.msg("checking block_hash(shareid=%d, blocknum=%d) len=%d" %
+ # (self.sharenum, blocknum, len(blockdata)))
+ blockhash = hashtree.block_hash(blockdata)
# we always validate the blockhash
bh = dict(enumerate(blockhashes))
# replace blockhash root with validated value
from zope.interface import implements
from twisted.internet import defer
from twisted.python import log
-from allmydata.hashtree import HashTree
+from allmydata.hashtree import HashTree, block_hash
from allmydata.Crypto.Cipher import AES
-from allmydata.util import mathutil, hashutil
+from allmydata.util import mathutil
from allmydata.util.assertutil import _assert
from allmydata.codec import CRSEncoder
from allmydata.interfaces import IEncoder
shareid = shareids[i]
d = self.send_subshare(shareid, segnum, subshare)
dl.append(d)
- subshare_hash = hashutil.tagged_hash("encoded subshare", subshare)
+ subshare_hash = block_hash(subshare)
self.subshare_hashes[shareid].append(subshare_hash)
dl = defer.DeferredList(dl)
def _logit(res):