| OLD | NEW |
| (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 NET_EXPORT uint64_t CalculateAuditPathLength(uint64_t leaf_index, |
| 22 uint64_t tree_size); |
| 23 |
| 24 // Audit proof for a Merkle tree leaf, as defined in section 2.1.1. of RFC6962. |
| 25 struct NET_EXPORT MerkleAuditProof { |
| 26 MerkleAuditProof(); |
| 27 MerkleAuditProof(const std::string& log_id, |
| 28 uint64_t leaf_index, |
| 29 const std::vector<std::string>& audit_path); |
| 30 ~MerkleAuditProof(); |
| 31 |
| 32 // The origin of this proof. |
| 33 std::string log_id; |
| 34 |
| 35 // Index of the tree leaf in the log. |
| 36 uint64_t leaf_index = 0; |
| 37 |
| 38 // Audit path nodes. |
| 39 std::vector<std::string> nodes; |
| 40 }; |
| 41 |
| 42 } // namespace ct |
| 43 } // namespace net |
| 44 |
| 45 #endif // NET_CERT_MERKLE_AUDIT_PROOF_H_ |
| OLD | NEW |