Crypto++  5.6.4
Free C++ class library of cryptographic schemes
Classes | Typedefs | Functions
integer.h File Reference

Multiple precision integer with arithmetic operations. More...

Go to the source code of this file.

Classes

struct  InitializeInteger
 Performs static intialization of the Integer class. More...
 
class  Integer
 Multiple precision integer with arithmetic operations. More...
 
class  Integer::DivideByZero
 Exception thrown when division by 0 is encountered. More...
 
class  Integer::RandomNumberNotFound
 Exception thrown when a random number cannot be found that satisfies the condition. More...
 
class  Integer::OpenPGPDecodeErr
 Exception thrown when an error is encountered decoding an OpenPGP integer. More...
 

Typedefs

typedef SecBlock< word, AllocatorWithCleanup< word, 0 > > IntegerSecBlock
 

Functions

bool operator== (const ::Integer &a, const ::Integer &b)
 
bool operator!= (const ::Integer &a, const ::Integer &b)
 
bool operator> (const ::Integer &a, const ::Integer &b)
 
bool operator>= (const ::Integer &a, const ::Integer &b)
 
bool operator< (const ::Integer &a, const ::Integer &b)
 
bool operator<= (const ::Integer &a, const ::Integer &b)
 
inline::Integer operator+ (const ::Integer &a, const ::Integer &b)
 
inline::Integer operator- (const ::Integer &a, const ::Integer &b)
 
inline::Integer operator* (const ::Integer &a, const ::Integer &b)
 
inline::Integer operator/ (const ::Integer &a, const ::Integer &b)
 
inline::Integer operator% (const ::Integer &a, const ::Integer &b)
 
inline::Integer operator/ (const ::Integer &a,::word b)
 
inline::word operator% (const ::Integer &a,::word b)
 
void swap (::Integer &a,::Integer &b)
 

Detailed Description

Multiple precision integer with arithmetic operations.

The Integer class can represent positive and negative integers with absolute value less than (256**sizeof(word))(256**sizeof(int)).

Internally, the library uses a sign magnitude representation, and the class has two data members. The first is a IntegerSecBlock (a SecBlock<word>) and it is used to hold the representation. The second is a Sign, and its is used to track the sign of the Integer.

Definition in file integer.h.

Function Documentation

inline ::Integer operator* ( const ::Integer a,
const ::Integer b 
)
See also
a_times_b_mod_c() and a_exp_b_mod_c()

Definition at line 591 of file integer.h.

inline ::Integer operator% ( const ::Integer a,
const ::Integer b 
)
See also
a_times_b_mod_c() and a_exp_b_mod_c()

Definition at line 596 of file integer.h.

inline ::word operator% ( const ::Integer a,
::word  b 
)
See also
a_times_b_mod_c() and a_exp_b_mod_c()

Definition at line 601 of file integer.h.