# Methodology of Testing the Security of Cryptographic Protocols Using the CMMTree Framework
## 4 Description of the Methodology
### Primary Structures and Generalization of the Problem  
The implementation of the CMMTree model is written in C++. Its main component is a two-parameter class template:  
template <class X, template<typename> class pred_type> class CMMTree(/*... */);  
The first parameter (X) is a _type parameter_. It represents the type of data for which (as a result of source code compilation) a particular version of the CMMTree class will be created. The second (pred_type) is a _template parameter_, i.e., a template of the type parameter, that--in this particular case--is parameterized by the first parameter of the CMMTree class template. By the second parameter, a predicate is passed that specifies the conditions for connecting the tree's nodes. More details on the implementation of the PF are provided in [14]. Various types of so-called primitive structures are used to describe protocol specifications [49; 50]. Each of these structures, to a greater or lesser extent, differs from the others regarding the scope of information stored and how to implement specific functionalities. For example, the decryption of messages encrypted with an asymmetric key and those encrypted with a symmetric key must be implemented differently. For this reason, at first glance, specifying only one type of parameter for a solution that is supposed to process many different types of data seems inconvenient. In practice, however, it is quite the opposite, because using the general programming technique allows the code developed in this way to operate on any data structure, provided that it meets certain syntactic and semantic requirements [51]. Therefore, it was decided that the primitives used to record the input data would have to form a hierarchy of classes, shown in Figure 3.  
From the perspective of generalizing the problem of cryptographic protocol processing, the **content** class plays the main role. It is an abstract base class whose main (and only) task is to provide a common interface for the other derived classes. Appropriate objects of derived classes store the real data. Table 1 presents brief information on classes inheriting from the content class. If only because of the volume, their detailed description goes beyond the scope of this work. However, how objects of these types are used is important. Therefore, to be able to use  
Figure 3: Class hierarchy of processed data. the described solution for examining various protocols, the input data (steps of generated protocol executions) are converted into the **chain** type--see Figure 1.  
In this class, all information, the quantity, type, and scope of which are not known beforehand, is represented by the vectors of pointers to the **content** type. Having the addresses of individual objects, the polymorphism of virtual functions and the RTTI (**RunTime**Type**Information--a mechanism that provides information about an object's data type at run-time) mechanism [51] can be employed to extract detailed information specific to the actual type of data being processed. Vector **needs** represent (that is, contain the addresses of the relevant objects) a collection of objects that the sender needs to complete a step. For example, this vector may contain addresses of nonce, tStamp, aCryptogram, or sCryptogram class objects. However, it cannot contain addresses of objects that represent publicly known objects to protocol participants (public keys, identifiers). Vector **products** represent objects that the sender must generate before the protocol step execution. These objects are also needed for the sender to complete the protocol step. Usually there are addresses of objects of type tStamp, nonce, or sKey. The **knowledge** vector is intended for objects containing information the recipient learns during a given protocol step. For instance, these can be objects of classes nonce, tStamp, or aCryptogram. The **antichain** class refers to objects representing how an Intruder can execute a protocol step depending on his knowledge.