# Methodology of Testing the Security of Cryptographic Protocols Using the CMMTree Framework
## 4 Description of the Methodology
### Properties and Functionalities of the CMMTree Model
CMMTree does not use node linking specific to binary tree linking [43; 44; 45; 47]. Each node (except the root) stores the address of its parent and the address of a dynamic vector containing the addresses of its children--see Figure 2.  
Each node also stores the address to the appropriate element \(d_{x}\) of the input dataset **D**. In this way, data from the data layer are isolated from the structure created in the relationship layer. Since each node has the direct address of its parent, it is possible to directly determine paths (from a given node to the root) in \(O(i)\) time. Figure 2: The CMMTree relationship layer implementation diagram. The mark (\(\bullet\)) in the jagged table means that each row is a vector of firstborn node addresses. The tree construction algorithm was implemented using the level-order strategy. However, unlike the traditional approach [46; 47; 48], in which the set of nodes from the last level of the tree is remembered, a custom solution was used in which the set of addresses of only the firstborn nodes is stored [14]--see Figure 2. By using the address of any firstborn node, we gain access to its parent, the parent's children, i.e., siblings of the firstborn, the parent's parent, and so on. Gaining access to the selected node, we immediately know what the size of the vector of addresses of its children is, that is, how many children it has or that it is a leaf. If we have a set of addresses of all the firstborns of one level (\(l\)) of the tree \(\mathbf{T}\), we can also determine the number of all nodes of this level and the number of leaves. Consequently, the set of firstborn addresses from all levels of the tree (see Figure 2) maps the entire structure \(\mathbf{T}\). Thus, we can see that the single-node structure presented earlier as well as the implementation of interconnections between nodes makes it possible, with the help of firstborn node addresses, to \"look deep\" into any part of the tree. This eliminates the need for time-consuming traversing of the tree, which in traditional solutions would always have to begin from the root node. The collection of addresses of all firstborn nodes (see Figure 2, jagged table) is a kind of view of the whole tree \(\mathbf{T}\). The jagged table is indexed. Thus, it gives free access to the tree \(\mathbf{T}\) of relationships existing between the input data. It directly provides information about the height \(h\) of tree \(\mathbf{T}\):  
\[h=\texttt{MTree.size()-1}\]  
as well as the number of firstborns (\(\Phi_{l}\)) of the selected tree level \(l\):  
\[\Phi_{l}=\texttt{MTree[l].size()}.\]  
By selecting any firstborn node address (from the jagged table), we can check the number of all the parent's children \(X_{l,j}\):  
\[X_{l,j}=children\Big{(}parent(\varphi_{l,j})\Big{)}=\texttt{MTree[l][j]->parent-> children_num()},\]  
where children_num() is a member function of the class node. We can also gain direct access to the brother or sister \(v_{l,k}\):  
\[v_{l,k}=k\_child\Big{(}parent(\varphi_{l,j}),k\Big{)}=\star\texttt{(MTree[l][j] ->parent->children)[k]}.\]  
From the above, we can see that each address of the firstborn node \(\varphi_{l,j}\) (\(\texttt{MTree[l][j]}\)) maps a particular group of nodes, i.e., the parent and its children. This means that the set of addresses of all firstborn nodes maps the entire tree \(\mathbf{T}\). Using Formula (3) allows us to determine the total number of nodes \(N_{l}\) of the selected tree level \(l\), and Equation (4) can be used to determine the total number of leaves \(\Lambda_{l}\) at this level. As a result, the shape of an entire tree \(\mathbf{T}\) or forest \(\mathbf{F}\) can be (parametrically) described using Formula (5). \[\bigwedge_{l\in\mathbb{N},\ 0\leq l\leq h}N_{l}=\sum_{x=0}^{n_{l}-1}v_{l,x}\ ;\ n_{l}= \begin{cases}1&\text{if}\ \ l=0\\ \sum_{j=0}^{\Phi_{l}-1}X_{l,j}&\text{if}\ \ l>0\end{cases}  \tag{3}\]  
\[\bigwedge_{l\in\mathbb{N},\ 0\leq l\leq h}\Lambda_{l}=\sum_{i}\lambda_{l,i}= \begin{cases}N_{l}-\Phi_{l+1}&\text{if}\ \ \ l<h\\ N_{l}&\text{if}\ \ \ l=h\end{cases}