
Engineering principlesThe toolkit contains no (non-constant) global variables, and can be used in multi-threaded and multi-tasking environments. All calls follow a simple construct-set-use-destruct pattern, allowing simple interfaces to an object-oriented application. All interfaces are fully specified in a way that can be interpreted in assembler, allowing subsets of the system to be used in a wide variety of circumstances. ModularityThe toolkit consists of about thirty independent modules, each with precise specifications and several implementations. This enables the user to select - independently for each application - the exact functionality, performance and memory usage required. Functionality of minor importance can be serviced with a very small module, leaving space for high performance implementations of the important functions. As a typical example, in an application where only the RSA implementation is speed critical and memory constraints are tight, one could select a speed-optimised version of RSA and memory-optimised versions of the other modules. If, at a later date, the requirements should change, individual modules can be replaced as desired and the uniformity of the interface means no further work is needed. Memory modelAll internal memory allocations (there are about twenty in total in the toolkit) use the mem module, which comes in several interchangeable versions. The simplest version just assumes that an operating system call will be made. Another version allocates a fixed (#define'd) amount of memory at the start, and uses and re-uses this memory from then on. This allows an embedded system to be absolutely certain that memory allocation failure cannot occur. The memory needed for such an allocation can be calculated precisely for a given set of functionality, using internal toolkit functions. There is also a range of `cache' systems that allow data included at compile time, or calculated by previous calls with the same environment, to be used to improve performance. Library dependenciesThe CPKtec library does not require any libraries. It must be possible to allocate memory somehow, but this requirement is encapsulated into a tiny module (which, for example, calls malloc if it is available). Quantifying performanceThe CPKtec toolkit is quantitative about performance. A "T-number" is used to define the tradeoff a particular implementation makes between speed and size.
| ||