Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: net/cert/merkle_audit_proof.h

Issue 2004843002: Adds a MerkleAuditProof struct to net/cert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses review comment from eroman Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/cert/merkle_audit_proof.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_CERT_MERKLE_AUDIT_PROOF_H_
6 #define NET_CERT_MERKLE_AUDIT_PROOF_H_
7
8 #include <stdint.h>
9
10 #include <string>
11 #include <vector>
12
13 #include "base/macros.h"
14 #include "net/base/net_export.h"
15
16 namespace net {
17 namespace ct {
18
19 // Returns the length of the audit path for a leaf at |leaf_index| in a Merkle
20 // tree containing |tree_size| leaves.
21 // The |leaf_index| must be less than the |tree_size|.
22 NET_EXPORT uint64_t CalculateAuditPathLength(uint64_t leaf_index,
23 uint64_t tree_size);
24
25 // Audit proof for a Merkle tree leaf, as defined in section 2.1.1. of RFC6962.
26 struct NET_EXPORT MerkleAuditProof {
27 MerkleAuditProof();
28 MerkleAuditProof(const std::string& log_id,
29 uint64_t leaf_index,
30 const std::vector<std::string>& audit_path);
31 ~MerkleAuditProof();
32
33 // The origin of this proof.
34 std::string log_id;
35
36 // Index of the tree leaf in the log.
37 uint64_t leaf_index = 0;
38
39 // Audit path nodes.
40 std::vector<std::string> nodes;
41 };
42
43 } // namespace ct
44 } // namespace net
45
46 #endif // NET_CERT_MERKLE_AUDIT_PROOF_H_
OLDNEW
« no previous file with comments | « no previous file | net/cert/merkle_audit_proof.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698