mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-05-02 09:03:00 +00:00
fix SHARE_HASH_CHAIN_SIZE computation
This commit is contained in:
parent
dd23f265bf
commit
eec428ba5f
@ -548,10 +548,10 @@ MDMFOFFSETS_LENGTH = struct.calcsize(MDMFOFFSETS)
|
|||||||
PRIVATE_KEY_SIZE = 1220
|
PRIVATE_KEY_SIZE = 1220
|
||||||
SIGNATURE_SIZE = 260
|
SIGNATURE_SIZE = 260
|
||||||
VERIFICATION_KEY_SIZE = 292
|
VERIFICATION_KEY_SIZE = 292
|
||||||
# We know we won't have more than 256 shares, and we know that we won't
|
# We know we won't have more than 256 shares, and we know that we won't need
|
||||||
# need to store more than lg 256 of them to validate, so that's our
|
# to store more than ln2(256) hash-chain nodes to validate, so that's our
|
||||||
# bound. We add 1 to the int cast to round to the next integer.
|
# bound. Each node requires 2 bytes of node-number plus 32 bytes of hash.
|
||||||
SHARE_HASH_CHAIN_SIZE = int(math.log(HASH_SIZE * 256)) + 1
|
SHARE_HASH_CHAIN_SIZE = (2+HASH_SIZE)*mathutil.log_ceil(256, 2)
|
||||||
|
|
||||||
class MDMFSlotWriteProxy:
|
class MDMFSlotWriteProxy:
|
||||||
implements(IMutableSlotWriter)
|
implements(IMutableSlotWriter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user