Chromium Code Reviews| Index: extensions/browser/content_hash_tree.h |
| diff --git a/extensions/browser/content_hash_tree.h b/extensions/browser/content_hash_tree.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d131b418fcbcbff630574ce91eb621ff57d2cef9 |
| --- /dev/null |
| +++ b/extensions/browser/content_hash_tree.h |
| @@ -0,0 +1,22 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef EXTENSIONS_BROWSER_CONTENT_HASH_TREE_H_ |
| +#define EXTENSIONS_BROWSER_CONTENT_HASH_TREE_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +namespace extensions { |
| + |
| +// This takes a list of sha256 hashes, considers them to be leaf nodes of a |
| +// hash tree (aka Merkle tree), and computes the hash of the root node of the |
| +// tree using a branching factor of |block_size| / sizeof(sha256hash). The |
| +// block size should be a multiple of sizeof(sha256hash). |
|
Marijn Kruisselbrink
2014/05/12 17:53:45
From the code here it isn't entirely clear why you
Marijn Kruisselbrink
2014/05/12 17:53:45
You should probably explicitly document how this m
asargent_no_longer_on_chrome
2014/05/12 21:58:58
Added documentation about numbers of nodes that ar
asargent_no_longer_on_chrome
2014/05/12 21:58:58
I refactored this code out from being inline in an
|
| +std::string ComputeTreeHashRoot(const std::vector<std::string>& leaf_hashes, |
| + int block_size); |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_BROWSER_CONTENT_HASH_TREE_H_ |