Merge lp://staging/~jderose/filestore/protocol-fix into lp://staging/filestore

Proposed by Jason Gerard DeRose
Status: Merged
Merged at revision: 213
Proposed branch: lp://staging/~jderose/filestore/protocol-fix
Merge into: lp://staging/filestore
Diff against target: 519 lines (+147/-110)
4 files modified
doc/filestore.rst (+35/-7)
doc/protocol.rst (+95/-78)
filestore.py (+7/-15)
test_filestore.py (+10/-10)
To merge this branch: bzr merge lp://staging/~jderose/filestore/protocol-fix
Reviewer Review Type Date Requested Status
David Jordan Approve
Review via email: mp+76162@code.staging.launchpad.net

Description of the change

This adds 2 new personalization strings:

PERS_LEAF_INDEX = b'20110430 <email address hidden> dmedia/leaf-index'
PERS_FILE_SIZE = b'20110430 <email address hidden> dmedia/file-size'

And 2 new hashing functions:

hash_leaf_index()
hash_file_size()

And updates hash_leaf() and hash_root() so that instead of simple concatenation like this:

leaf_hashes = skein512(str(leaf_index).encode('utf-8') + leaf_data)
root_hash = skein515(str(file_size).encode('utf-8') + leaf_hashes)

They now do this:

leaf_hashes = skein512(hash_leaf_index(leaf_index) + leaf_data)
root_hash = skein515(hash_file_size(file_size) + leaf_hashes)

Other than that, I just updated the test case values and the documentation.

Thanks again, friendly anonymous reviewer!

To post a comment you must log in.
Revision history for this message
David Jordan (dmj726) wrote :

Good catch, definitely approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches