xref: /aosp_15_r20/external/cronet/net/cert/merkle_consistency_proof.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2015 The Chromium Authors
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_CONSISTENCY_PROOF_H_
6 #define NET_CERT_MERKLE_CONSISTENCY_PROOF_H_
7 
8 #include <stdint.h>
9 
10 #include <string>
11 #include <vector>
12 
13 #include "net/base/net_export.h"
14 
15 namespace net::ct {
16 
17 // Consistency proof between two STHs as defined in section 2.1.2. of RFC6962.
18 struct NET_EXPORT MerkleConsistencyProof {
19   MerkleConsistencyProof();
20   MerkleConsistencyProof(const std::string& log_id,
21                          const std::vector<std::string>& proof_nodes,
22                          uint64_t old_size,
23                          uint64_t new_size);
24   ~MerkleConsistencyProof();
25 
26   // The origin of this proof.
27   std::string log_id;
28 
29   // Consistency proof nodes.
30   std::vector<std::string> nodes;
31 
32   // Size of the older tree.
33   uint64_t first_tree_size = 0;
34 
35   // Size of the newer tree.
36   uint64_t second_tree_size = 0;
37 };
38 
39 }  // namespace net::ct
40 
41 #endif  // NET_CERT_MERKLE_CONSISTENCY_PROOF_H_
42