integer.h File Reference

Multiple precision integer with arithmetic operations. More...

Go to the source code of this file.

## Classes

struct | InitializeInteger
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

## operator*()

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 595 of file integer.h.

## operator%() [1/2]

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 600 of file integer.h.

## operator%() [2/2]

inline ::word operator% | ( | const ::Integer & | a,
|  | ::word | b
| ) |  |

See also
  a_times_b_mod_c() and a_exp_b_mod_c()

Definition at line 605 of file integer.h.