Cryptography Reference
In-Depth Information
methods. 3 The (few) details of the data structures will be hidden both from the
user and the client of the class, as will the implementation of the numerous
arithmetic and number-theoretic functions. However, before we can use the
classes they must be developed, and in this regard we shall have to get our hands
dirty with the internal details. Nonetheless, it will surprise no one that we are not
going to begin from scratch, but rather make use of the implementation work that
we accomplished in the first part of the topic and formulate the arithmetic class
as an abstract layer, or shell, around our C library.
We shall give the name LINT (Large INTegers) to our class. It will contain
data structures and functions as components with the attribute public , which
determine the possibilities for external access. Access to the structures of the
class declared as private , on the other hand, can be accomplished only with
functions that have been declared either a member or friend of the class. Member
functions of the class LINT can access the functions and data elements of
LINT objects by name and are required for servicing the external interface, for
processing instructions to the class, and serving as fundamental routines and
auxiliary functions for managing and processing internal data structures. Member
functions of the class LINT always possess a LINT object as implied left argument,
which does not appear in its parameter list. Friend functions of the class do not
belong to the class, but they can nonetheless access the internal structure of
the class. Unlike the member functions, the friend functions do not possess an
implicit argument.
Objects are generated as instances of a class by means of constructors ,
which complete the allocation of memory, the initialization of data, and other
management tasks before an object is ready for action. We shall require several
such constructors in order to generate our LINT objects from various contexts.
Complementary to the constructors we have destructors , which serve the purpose
of removing objects that are no longer needed and releasing the resources that
have been bound to them.
The elements of C++ that we shall particularly use for our class development
are the following:
the overloading of operators and functions;
the improved possibilities, vis à vis C, for input and output.
The following sections are devoted to the application of these two principles
in the framework of our LINT class. To give the reader an idea of the form that the
LINT class will assume, we show a small segment of its declaration:
3
The reader is referred to several works in the standard literature for an introduction to C++ and
discussions about it, namely [ElSt], [Str1], [Str2], [Deit], [Lipp], just to name a few of the more
important titles. In particular, [ElSt] was taken as the basis for the standardization by the ISO.
 
Search WWH ::




Custom Search