| 1 | #cxx . . $ `<file>/mlspp/include/mls/treekem.h`/pragma once |
| 2 | |
| 3 | #include "mls/common.h"cxx . . $ `<file>/mlspp/include/mls/common.h`/ |
| 4 | #include "mls/core_types.h"cxx . . $ `<file>/mlspp/include/mls/core_types.h`/ |
| 5 | #include "mls/crypto.h"cxx . . $ `<file>/mlspp/include/mls/crypto.h`/ |
| 6 | #include "mls/tree_math.h"cxx . . $ `<file>/mlspp/include/mls/tree_math.h`/ |
| 7 | #include <tls/tls_syntax.h>cxx . . $ `<file>/mlspp/lib/bytes/include/tls/tls_syntax.h`/ |
| 8 | |
| 9 | #define ENABLE_TREE_DUMPcxx . . $ `mlspp/include/mls/treekem.h:9:9`! 1 |
| 10 | |
| 11 | namespace mlsppcxx . . $ mlspp/ { |
| 12 | |
| 13 | enum struct NodeTypecxx . . $ mlspp/NodeType# : uint8_tcxx . . $ uint8_t# |
| 14 | { |
| 15 | reservedcxx . . $ mlspp/NodeType#reserved. = 0x00, |
| 16 | leafcxx . . $ mlspp/NodeType#leaf. = 0x01, |
| 17 | parentcxx . . $ mlspp/NodeType#parent. = 0x02, |
| 18 | }; |
| 19 | |
| 20 | struct Nodecxx . . $ mlspp/Node# |
| 21 | { |
| 22 | var::variantcxx . . $ std/variant#<LeafNodecxx . . $ mlspp/LeafNode#, ParentNodecxx . . $ mlspp/ParentNode#> nodecxx . . $ mlspp/Node#node.; |
| 23 | |
| 24 | const HPKEPublicKeycxx . . $ mlspp/HPKEPublicKey#& public_keycxx . . $ mlspp/Node#public_key(d5c38d46ab7a7ba1).() const; |
| 25 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<bytescxx . . $ mlspp/bytes_ns/bytes#> parent_hashcxx . . $ mlspp/Node#parent_hash(82a679487d1deb04).() const; |
| 26 | |
| 27 | TLS_SERIALIZABLEcxx . . $ std/forward_as_tuple(cd19fb0d9524ec73).(node) |
| 28 | TLS_TRAITScxx . . $ mlspp/Node#_tls_traits#(tls::variant<NodeType>) |
| 29 | }; |
| 30 | |
| 31 | struct OptionalNodecxx . . $ mlspp/OptionalNode# |
| 32 | { |
| 33 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<Nodecxx . . $ mlspp/Node#> nodecxx . . $ mlspp/OptionalNode#node.; |
| 34 | |
| 35 | bool blankcxx . . $ mlspp/OptionalNode#blank(50ce9a9e25b4a850).() const { return !nodecxx . . $ mlspp/OptionalNode#node..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).(); } |
| 36 | bool leafcxx . . $ mlspp/OptionalNode#leaf(50ce9a9e25b4a850).() const |
| 37 | { |
| 38 | return !blankcxx . . $ mlspp/OptionalNode#blank(50ce9a9e25b4a850).() && var::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<LeafNodecxx . . $ mlspp/LeafNode#>(opt::getcxx . . $ mlspp/tls/opt/get(3a846ed22d48625).(nodecxx . . $ mlspp/OptionalNode#node.).nodecxx . . $ mlspp/Node#node.); |
| 39 | } |
| 40 | |
| 41 | LeafNodecxx . . $ mlspp/LeafNode#& leaf_nodecxx . . $ mlspp/OptionalNode#leaf_node(171a8ec9c86b3f09).() { return var::getcxx . . $ std/get(55ed64a6518b24d0).<LeafNodecxx . . $ mlspp/LeafNode#>(opt::getcxx . . $ mlspp/tls/opt/get(f3e04ae79584f296).(nodecxx . . $ mlspp/OptionalNode#node.).nodecxx . . $ mlspp/Node#node.); } |
| 42 | |
| 43 | const LeafNodecxx . . $ mlspp/LeafNode#& leaf_nodecxx . . $ mlspp/OptionalNode#leaf_node(2a430397a2a37286).() const |
| 44 | { |
| 45 | return var::getcxx . . $ std/get(ca5bafa5a3bcea9d).<LeafNodecxx . . $ mlspp/LeafNode#>(opt::getcxx . . $ mlspp/tls/opt/get(3a846ed22d48625).(nodecxx . . $ mlspp/OptionalNode#node.).nodecxx . . $ mlspp/Node#node.); |
| 46 | } |
| 47 | |
| 48 | ParentNodecxx . . $ mlspp/ParentNode#& parent_nodecxx . . $ mlspp/OptionalNode#parent_node(2dc0103e2d108373).() |
| 49 | { |
| 50 | return var::getcxx . . $ std/get(55ed64a6518b24d0).<ParentNodecxx . . $ mlspp/ParentNode#>(opt::getcxx . . $ mlspp/tls/opt/get(f3e04ae79584f296).(nodecxx . . $ mlspp/OptionalNode#node.).nodecxx . . $ mlspp/Node#node.); |
| 51 | } |
| 52 | |
| 53 | const ParentNodecxx . . $ mlspp/ParentNode#& parent_nodecxx . . $ mlspp/OptionalNode#parent_node(17c9744d3cd194d).() const |
| 54 | { |
| 55 | return var::getcxx . . $ std/get(ca5bafa5a3bcea9d).<ParentNodecxx . . $ mlspp/ParentNode#>(opt::getcxx . . $ mlspp/tls/opt/get(3a846ed22d48625).(nodecxx . . $ mlspp/OptionalNode#node.).nodecxx . . $ mlspp/Node#node.); |
| 56 | } |
| 57 | |
| 58 | TLS_SERIALIZABLEcxx . . $ std/(node) |
| 59 | }; |
| 60 | |
| 61 | struct TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#; |
| 62 | |
| 63 | struct TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey# |
| 64 | { |
| 65 | CipherSuitecxx . . $ mlspp/CipherSuite# suitecxx . . $ mlspp/TreeKEMPrivateKey#suite.; |
| 66 | LeafIndexcxx . . $ mlspp/LeafIndex# indexcxx . . $ mlspp/TreeKEMPrivateKey#index.; |
| 67 | bytescxx . . $ mlspp/bytes_ns/bytes# update_secretcxx . . $ mlspp/TreeKEMPrivateKey#update_secret.; |
| 68 | stdcxx . . $ std/::mapcxx . . $ std/map#<NodeIndexcxx . . $ mlspp/NodeIndex#, bytescxx . . $ mlspp/bytes_ns/bytes#> path_secretscxx . . $ mlspp/TreeKEMPrivateKey#path_secrets.; |
| 69 | stdcxx . . $ std/::mapcxx . . $ std/map#<NodeIndexcxx . . $ mlspp/NodeIndex#, HPKEPrivateKeycxx . . $ mlspp/HPKEPrivateKey#> private_key_cachecxx . . $ mlspp/TreeKEMPrivateKey#private_key_cache.; |
| 70 | |
| 71 | static TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey# solocxx . . $ mlspp/TreeKEMPrivateKey#solo(314639de3ba28cb).(CipherSuitecxx . . $ mlspp/CipherSuite# suite, |
| 72 | LeafIndexcxx . . $ mlspp/LeafIndex# index, |
| 73 | HPKEPrivateKeycxx . . $ mlspp/HPKEPrivateKey# leaf_priv); |
| 74 | static TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey# createcxx . . $ mlspp/TreeKEMPrivateKey#create(a23e82a828226b37).(const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& pub, |
| 75 | LeafIndexcxx . . $ mlspp/LeafIndex# from, |
| 76 | const bytescxx . . $ mlspp/bytes_ns/bytes#& leaf_secret); |
| 77 | static TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey# joinercxx . . $ mlspp/TreeKEMPrivateKey#joiner(3c3a8fd039c9c001).(const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& pub, |
| 78 | LeafIndexcxx . . $ mlspp/LeafIndex# index, |
| 79 | HPKEPrivateKeycxx . . $ mlspp/HPKEPrivateKey# leaf_priv, |
| 80 | NodeIndexcxx . . $ mlspp/NodeIndex# intersect, |
| 81 | const stdcxx . . $ std/::optionalcxx . . $ std/optional#<bytescxx . . $ mlspp/bytes_ns/bytes#>& path_secret); |
| 82 | |
| 83 | void set_leaf_privcxx . . $ mlspp/TreeKEMPrivateKey#set_leaf_priv(35c8eff745156dde).(HPKEPrivateKeycxx . . $ mlspp/HPKEPrivateKey# priv); |
| 84 | stdcxx . . $ std/::tuplecxx . . $ std/tuple#<NodeIndexcxx . . $ mlspp/NodeIndex#, bytescxx . . $ mlspp/bytes_ns/bytes#, bool> shared_path_secretcxx . . $ mlspp/TreeKEMPrivateKey#shared_path_secret(f9c1aa84c71de2c3).(LeafIndexcxx . . $ mlspp/LeafIndex# to) const; |
| 85 | |
| 86 | bool have_private_keycxx . . $ mlspp/TreeKEMPrivateKey#have_private_key(df9c6d3ab1251738).(NodeIndexcxx . . $ mlspp/NodeIndex# n) const; |
| 87 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<HPKEPrivateKeycxx . . $ mlspp/HPKEPrivateKey#> private_keycxx . . $ mlspp/TreeKEMPrivateKey#private_key(4d6c5a4be6fa7ce4).(NodeIndexcxx . . $ mlspp/NodeIndex# n); |
| 88 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<HPKEPrivateKeycxx . . $ mlspp/HPKEPrivateKey#> private_keycxx . . $ mlspp/TreeKEMPrivateKey#private_key(ff9927d09a546cdc).(NodeIndexcxx . . $ mlspp/NodeIndex# n) const; |
| 89 | |
| 90 | void decapcxx . . $ mlspp/TreeKEMPrivateKey#decap(ca2156724251758f).(LeafIndexcxx . . $ mlspp/LeafIndex# from, |
| 91 | const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& pub, |
| 92 | const bytescxx . . $ mlspp/bytes_ns/bytes#& context, |
| 93 | const UpdatePathcxx . . $ mlspp/UpdatePath#& path, |
| 94 | const stdcxx . . $ std/::vectorcxx . . $ std/vector#<LeafIndexcxx . . $ mlspp/LeafIndex#>& except); |
| 95 | |
| 96 | void truncatecxx . . $ mlspp/TreeKEMPrivateKey#truncate(a733f6ba51500b8c).(LeafCountcxx . . $ mlspp/LeafCount# size); |
| 97 | |
| 98 | bool consistentcxx . . $ mlspp/TreeKEMPrivateKey#consistent(5ec773e44f7a02e9).(const TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey#& other) const; |
| 99 | bool consistentcxx . . $ mlspp/TreeKEMPrivateKey#consistent(eaed869e1938a2dc).(const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& other) const; |
| 100 | |
| 101 | #if ENABLE_TREE_DUMPcxx . . $ `mlspp/include/mls/treekem.h:9:9`! |
| 102 | void dumpcxx . . $ mlspp/TreeKEMPrivateKey#dump(83f5f38750778ac8).() const; |
| 103 | #endif |
| 104 | |
| 105 | // TODO(RLB) Make this private but exposed to test vectors |
| 106 | void implantcxx . . $ mlspp/TreeKEMPrivateKey#implant(333467ad79be4356).(const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& pub, |
| 107 | NodeIndexcxx . . $ mlspp/NodeIndex# start, |
| 108 | const bytescxx . . $ mlspp/bytes_ns/bytes#& path_secret); |
| 109 | }; |
| 110 | |
| 111 | struct TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey# |
| 112 | { |
| 113 | CipherSuitecxx . . $ mlspp/CipherSuite# suitecxx . . $ mlspp/TreeKEMPublicKey#suite.; |
| 114 | LeafCountcxx . . $ mlspp/LeafCount# sizecxx . . $ mlspp/TreeKEMPublicKey#size.{ 0 }; |
| 115 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<OptionalNodecxx . . $ mlspp/OptionalNode#> nodescxx . . $ mlspp/TreeKEMPublicKey#nodes.; |
| 116 | |
| 117 | explicit TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#TreeKEMPublicKey(1ae84ca71f879861).(CipherSuitecxx . . $ mlspp/CipherSuite# suite); |
| 118 | |
| 119 | TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#TreeKEMPublicKey(49f6e7a06ebc5aa8).() = default; |
| 120 | TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#TreeKEMPublicKey(748824e58f275fcf).(const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& other) = default; |
| 121 | TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#TreeKEMPublicKey(a5928d9bef2ead0d).(TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#&& other) = default; |
| 122 | TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& operatorcxx . . $ mlspp/TreeKEMPublicKey#`operator=`(86f12d805300c086).=(const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& other) = default; |
| 123 | TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& operatorcxx . . $ mlspp/TreeKEMPublicKey#`operator=`(1bb68ced44cfb0e).=(TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#&& other) = default; |
| 124 | |
| 125 | LeafIndexcxx . . $ mlspp/LeafIndex# allocate_leafcxx . . $ mlspp/TreeKEMPublicKey#allocate_leaf(1c00ca8acb9206b2).(); |
| 126 | LeafIndexcxx . . $ mlspp/LeafIndex# add_leafcxx . . $ mlspp/TreeKEMPublicKey#add_leaf(9995a7bfeddd280).(const LeafNodecxx . . $ mlspp/LeafNode#& leaf); |
| 127 | void update_leafcxx . . $ mlspp/TreeKEMPublicKey#update_leaf(b4be21d46bd512a5).(LeafIndexcxx . . $ mlspp/LeafIndex# index, const LeafNodecxx . . $ mlspp/LeafNode#& leaf); |
| 128 | void blank_pathcxx . . $ mlspp/TreeKEMPublicKey#blank_path(5a3d3cee3fdf86fc).(LeafIndexcxx . . $ mlspp/LeafIndex# index); |
| 129 | |
| 130 | TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey# updatecxx . . $ mlspp/TreeKEMPublicKey#update(9c859f54cfdffec).(LeafIndexcxx . . $ mlspp/LeafIndex# from, |
| 131 | const bytescxx . . $ mlspp/bytes_ns/bytes#& leaf_secret, |
| 132 | const bytescxx . . $ mlspp/bytes_ns/bytes#& group_id, |
| 133 | const SignaturePrivateKeycxx . . $ mlspp/SignaturePrivateKey#& sig_priv, |
| 134 | const LeafNodeOptionscxx . . $ mlspp/LeafNodeOptions#& opts); |
| 135 | UpdatePathcxx . . $ mlspp/UpdatePath# encapcxx . . $ mlspp/TreeKEMPublicKey#encap(b02cdda980f00156).(const TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey#& priv, |
| 136 | const bytescxx . . $ mlspp/bytes_ns/bytes#& context, |
| 137 | const stdcxx . . $ std/::vectorcxx . . $ std/vector#<LeafIndexcxx . . $ mlspp/LeafIndex#>& except) const; |
| 138 | |
| 139 | void mergecxx . . $ mlspp/TreeKEMPublicKey#merge(5dcbaa0a66e57c87).(LeafIndexcxx . . $ mlspp/LeafIndex# from, const UpdatePathcxx . . $ mlspp/UpdatePath#& path); |
| 140 | void set_hash_allcxx . . $ mlspp/TreeKEMPublicKey#set_hash_all(49f6e7a06ebc5aa8).(); |
| 141 | const bytescxx . . $ mlspp/bytes_ns/bytes#& get_hashcxx . . $ mlspp/TreeKEMPublicKey#get_hash(1e11ec888f0fea7b).(NodeIndexcxx . . $ mlspp/NodeIndex# index); |
| 142 | bytescxx . . $ mlspp/bytes_ns/bytes# root_hashcxx . . $ mlspp/TreeKEMPublicKey#root_hash(d7392ba79aa35767).() const; |
| 143 | |
| 144 | bool parent_hash_validcxx . . $ mlspp/TreeKEMPublicKey#parent_hash_valid(de8db98f2089d9d5).(LeafIndexcxx . . $ mlspp/LeafIndex# from, const UpdatePathcxx . . $ mlspp/UpdatePath#& path) const; |
| 145 | bool parent_hash_validcxx . . $ mlspp/TreeKEMPublicKey#parent_hash_valid(50ce9a9e25b4a850).() const; |
| 146 | |
| 147 | bool has_leafcxx . . $ mlspp/TreeKEMPublicKey#has_leaf(be225f04b72ff6f7).(LeafIndexcxx . . $ mlspp/LeafIndex# index) const; |
| 148 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<LeafIndexcxx . . $ mlspp/LeafIndex#> findcxx . . $ mlspp/TreeKEMPublicKey#find(ce1aa2f7913b80cb).(const LeafNodecxx . . $ mlspp/LeafNode#& leaf) const; |
| 149 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<LeafNodecxx . . $ mlspp/LeafNode#> leaf_nodecxx . . $ mlspp/TreeKEMPublicKey#leaf_node(e2d641b4ea45e2f).(LeafIndexcxx . . $ mlspp/LeafIndex# index) const; |
| 150 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<NodeIndexcxx . . $ mlspp/NodeIndex#> resolvecxx . . $ mlspp/TreeKEMPublicKey#resolve(54fac8e335512371).(NodeIndexcxx . . $ mlspp/NodeIndex# index) const; |
| 151 | |
| 152 | template<typename UnaryPredicate> |
| 153 | bool all_leavescxx . . $ mlspp/TreeKEMPublicKey#all_leaves(8877ebe272b9620d).(const UnaryPredicate& pred) const |
| 154 | { |
| 155 | for (LeafIndexcxx . . $ mlspp/LeafIndex# i{ 0 }; i <cxx . . $ mlspp/LeafIndex#`operator<`(6a6f1ee87d9a491e). sizecxx . . $ mlspp/TreeKEMPublicKey#size.; i.valcxx . . $ mlspp/UInt32#val.++) { |
| 156 | const auto& node = node_atcxx . . $ mlspp/TreeKEMPublicKey#node_at(81e4f0422d7e507e).(i); |
| 157 | if (node.blankcxx . . $ mlspp/OptionalNode#blank(50ce9a9e25b4a850).()) { |
| 158 | continue; |
| 159 | } |
| 160 | |
| 161 | if (!pred(i, node.leaf_nodecxx . . $ mlspp/OptionalNode#leaf_node(2a430397a2a37286).())) { |
| 162 | return false; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | return true; |
| 167 | } |
| 168 | |
| 169 | template<typename UnaryPredicate> |
| 170 | bool any_leafcxx . . $ mlspp/TreeKEMPublicKey#any_leaf(8877ebe272b9620d).(const UnaryPredicate& pred) const |
| 171 | { |
| 172 | for (LeafIndexcxx . . $ mlspp/LeafIndex# i{ 0 }; i <cxx . . $ mlspp/LeafIndex#`operator<`(6a6f1ee87d9a491e). sizecxx . . $ mlspp/TreeKEMPublicKey#size.; i.valcxx . . $ mlspp/UInt32#val.++) { |
| 173 | const auto& node = node_atcxx . . $ mlspp/TreeKEMPublicKey#node_at(81e4f0422d7e507e).(i); |
| 174 | if (node.blankcxx . . $ mlspp/OptionalNode#blank(50ce9a9e25b4a850).()) { |
| 175 | continue; |
| 176 | } |
| 177 | |
| 178 | if (pred(i, node.leaf_nodecxx . . $ mlspp/OptionalNode#leaf_node(2a430397a2a37286).())) { |
| 179 | return true; |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | return false; |
| 184 | } |
| 185 | |
| 186 | using FilteredDirectPathcxx . . $ mlspp/TreeKEMPublicKey#FilteredDirectPath# = |
| 187 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::tuplecxx . . $ std/tuple#<NodeIndexcxx . . $ mlspp/NodeIndex#, stdcxx . . $ std/::vectorcxx . . $ std/vector#<NodeIndexcxx . . $ mlspp/NodeIndex#>>>; |
| 188 | FilteredDirectPathcxx . . $ mlspp/TreeKEMPublicKey#FilteredDirectPath# filtered_direct_pathcxx . . $ mlspp/TreeKEMPublicKey#filtered_direct_path(b755724fb327e77c).(NodeIndexcxx . . $ mlspp/NodeIndex# index) const; |
| 189 | |
| 190 | void truncatecxx . . $ mlspp/TreeKEMPublicKey#truncate(49f6e7a06ebc5aa8).(); |
| 191 | |
| 192 | OptionalNodecxx . . $ mlspp/OptionalNode#& node_atcxx . . $ mlspp/TreeKEMPublicKey#node_at(282ae2203a69cdd5).(NodeIndexcxx . . $ mlspp/NodeIndex# n); |
| 193 | const OptionalNodecxx . . $ mlspp/OptionalNode#& node_atcxx . . $ mlspp/TreeKEMPublicKey#node_at(7c807605eec2a484).(NodeIndexcxx . . $ mlspp/NodeIndex# n) const; |
| 194 | OptionalNodecxx . . $ mlspp/OptionalNode#& node_atcxx . . $ mlspp/TreeKEMPublicKey#node_at(cb98b8279b84ec8f).(LeafIndexcxx . . $ mlspp/LeafIndex# n); |
| 195 | const OptionalNodecxx . . $ mlspp/OptionalNode#& node_atcxx . . $ mlspp/TreeKEMPublicKey#node_at(81e4f0422d7e507e).(LeafIndexcxx . . $ mlspp/LeafIndex# n) const; |
| 196 | |
| 197 | TLS_SERIALIZABLEcxx . . $ mlspp/TreeKEMPublicKey#_tls_serializable.(nodes) |
| 198 | |
| 199 | #if ENABLE_TREE_DUMPcxx . . $ `mlspp/include/mls/treekem.h:9:9`! |
| 200 | void dumpcxx . . $ mlspp/TreeKEMPublicKey#dump(83f5f38750778ac8).() const; |
| 201 | #endif |
| 202 | |
| 203 | private: |
| 204 | stdcxx . . $ std/::mapcxx . . $ std/map#<NodeIndexcxx . . $ mlspp/NodeIndex#, bytescxx . . $ mlspp/bytes_ns/bytes#> hashescxx . . $ mlspp/TreeKEMPublicKey#hashes.; |
| 205 | |
| 206 | void clear_hash_allcxx . . $ mlspp/TreeKEMPublicKey#clear_hash_all(49f6e7a06ebc5aa8).(); |
| 207 | void clear_hash_pathcxx . . $ mlspp/TreeKEMPublicKey#clear_hash_path(5a3d3cee3fdf86fc).(LeafIndexcxx . . $ mlspp/LeafIndex# index); |
| 208 | |
| 209 | bool has_parent_hashcxx . . $ mlspp/TreeKEMPublicKey#has_parent_hash(a14d1792dfe14d87).(NodeIndexcxx . . $ mlspp/NodeIndex# child, const bytescxx . . $ mlspp/bytes_ns/bytes#& target_ph) const; |
| 210 | |
| 211 | bytescxx . . $ mlspp/bytes_ns/bytes# parent_hashcxx . . $ mlspp/TreeKEMPublicKey#parent_hash(600469b6cb5d3224).(const ParentNodecxx . . $ mlspp/ParentNode#& parent, NodeIndexcxx . . $ mlspp/NodeIndex# copath_child) const; |
| 212 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<bytescxx . . $ mlspp/bytes_ns/bytes#> parent_hashescxx . . $ mlspp/TreeKEMPublicKey#parent_hashes(2f270ebbd853fb5).( |
| 213 | LeafIndexcxx . . $ mlspp/LeafIndex# from, |
| 214 | const FilteredDirectPathcxx . . $ mlspp/TreeKEMPublicKey#FilteredDirectPath#& fdp, |
| 215 | const stdcxx . . $ std/::vectorcxx . . $ std/vector#<UpdatePathNodecxx . . $ mlspp/UpdatePathNode#>& path_nodes) const; |
| 216 | |
| 217 | using TreeHashCachecxx . . $ mlspp/TreeKEMPublicKey#TreeHashCache# = stdcxx . . $ std/::mapcxx . . $ std/map#<NodeIndexcxx . . $ mlspp/NodeIndex#, stdcxx . . $ std/::paircxx . . $ std/pair#<size_t, bytescxx . . $ mlspp/bytes_ns/bytes#>>; |
| 218 | const bytescxx . . $ mlspp/bytes_ns/bytes#& original_tree_hashcxx . . $ mlspp/TreeKEMPublicKey#original_tree_hash(dfa38275fb6e05bc).(TreeHashCachecxx . . $ mlspp/TreeKEMPublicKey#TreeHashCache#& cache, |
| 219 | NodeIndexcxx . . $ mlspp/NodeIndex# index, |
| 220 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<LeafIndexcxx . . $ mlspp/LeafIndex#> parent_except) const; |
| 221 | bytescxx . . $ mlspp/bytes_ns/bytes# original_parent_hashcxx . . $ mlspp/TreeKEMPublicKey#original_parent_hash(1cc6965e803bdea9).(TreeHashCachecxx . . $ mlspp/TreeKEMPublicKey#TreeHashCache#& cache, |
| 222 | NodeIndexcxx . . $ mlspp/NodeIndex# parent, |
| 223 | NodeIndexcxx . . $ mlspp/NodeIndex# sibling) const; |
| 224 | |
| 225 | bool exists_in_treecxx . . $ mlspp/TreeKEMPublicKey#exists_in_tree(a28fd0d7d55e435a).(const HPKEPublicKeycxx . . $ mlspp/HPKEPublicKey#& key, |
| 226 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<LeafIndexcxx . . $ mlspp/LeafIndex#> except) const; |
| 227 | bool exists_in_treecxx . . $ mlspp/TreeKEMPublicKey#exists_in_tree(e34b2eb2d389dc07).(const SignaturePublicKeycxx . . $ mlspp/SignaturePublicKey#& key, |
| 228 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<LeafIndexcxx . . $ mlspp/LeafIndex#> except) const; |
| 229 | |
| 230 | OptionalNodecxx . . $ mlspp/OptionalNode# blank_nodecxx . . $ mlspp/TreeKEMPublicKey#blank_node.; |
| 231 | |
| 232 | friend struct TreeKEMPrivateKeycxx . . $ mlspp/TreeKEMPrivateKey#; |
| 233 | }; |
| 234 | |
| 235 | tlscxx . . $ mlspp/tls/::ostreamcxx . . $ mlspp/tls/ostream#& |
| 236 | operatorcxx . . $ mlspp/`operator<<`(9b37aeb90c040d6a).<<(tlscxx . . $ mlspp/tls/::ostreamcxx . . $ mlspp/tls/ostream#& str, const TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& obj); |
| 237 | tlscxx . . $ mlspp/tls/::istreamcxx . . $ mlspp/tls/istream#& |
| 238 | operatorcxx . . $ mlspp/`operator>>`(28db5d42b9a5186e).>>(tlscxx . . $ mlspp/tls/::istreamcxx . . $ mlspp/tls/istream#& str, TreeKEMPublicKeycxx . . $ mlspp/TreeKEMPublicKey#& obj); |
| 239 | |
| 240 | struct LeafNodeHashInputcxx . . $ mlspp/LeafNodeHashInput#; |
| 241 | struct ParentNodeHashInputcxx . . $ mlspp/ParentNodeHashInput#; |
| 242 | |
| 243 | } // namespace mlspp |
| 244 | |
| 245 | namespace mlsppcxx . . $ mlspp/::tlscxx . . $ mlspp/tls/ { |
| 246 | |
| 247 | TLS_VARIANT_MAPcxx . . $ mlspp/NodeType#leaf.(mlspp::NodeType, mlspp::LeafNodeHashInput, leaf) |
| 248 | TLS_VARIANT_MAPcxx . . $ mlspp/(mlspp::NodeType, |
| 249 | mlspp::ParentNodeHashInput, |
| 250 | parent) |
| 251 | |
| 252 | TLS_VARIANT_MAPcxx . . $ mlspp/LeafNode#(mlspp::NodeType, mlspp::LeafNode, leaf) |
| 253 | TLS_VARIANT_MAPcxx . . $ mlspp/NodeType#parent.(mlspp::NodeType, mlspp::ParentNode, parent) |
| 254 | |
| 255 | } // namespace mlspp::tls |