Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ModularArithmetic Class Reference

#include <modarith.h>

Inheritance diagram for ModularArithmetic:

AbstractRing< Integer > AbstractGroup< Integer > MontgomeryRepresentation List of all members.

Detailed Description

ring of congruence classes modulo n

Note:
this implementation represents each congruence class as the smallest non-negative integer in that class

Definition at line 19 of file modarith.h.

Public Types

typedef int RandomizationParameter
typedef Integer Element

Public Member Functions

 ModularArithmetic (const Integer &modulus=Integer::One())
 ModularArithmetic (const ModularArithmetic &ma)
 ModularArithmetic (BufferedTransformation &bt)
virtual ModularArithmeticClone () const
void DEREncode (BufferedTransformation &bt) const
void DEREncodeElement (BufferedTransformation &out, const Element &a) const
void BERDecodeElement (BufferedTransformation &in, Element &a) const
const IntegerGetModulus () const
void SetModulus (const Integer &newModulus)
virtual bool IsMontgomeryRepresentation () const
virtual Integer ConvertIn (const Integer &a) const
virtual Integer ConvertOut (const Integer &a) const
const IntegerHalf (const Integer &a) const
bool Equal (const Integer &a, const Integer &b) const
const IntegerIdentity () const
const IntegerAdd (const Integer &a, const Integer &b) const
IntegerAccumulate (Integer &a, const Integer &b) const
const IntegerInverse (const Integer &a) const
const IntegerSubtract (const Integer &a, const Integer &b) const
IntegerReduce (Integer &a, const Integer &b) const
const IntegerDouble (const Integer &a) const
const IntegerMultiplicativeIdentity () const
const IntegerMultiply (const Integer &a, const Integer &b) const
const IntegerSquare (const Integer &a) const
bool IsUnit (const Integer &a) const
const IntegerMultiplicativeInverse (const Integer &a) const
const IntegerDivide (const Integer &a, const Integer &b) const
Integer CascadeExponentiate (const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const
void SimultaneousExponentiate (Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const
unsigned int MaxElementBitLength () const
unsigned int MaxElementByteLength () const
Element RandomElement (RandomNumberGenerator &rng, const RandomizationParameter &ignore_for_now=0) const
bool operator== (const ModularArithmetic &rhs) const
virtual bool IsUnit (const Element &a) const=0
virtual const ElementMultiply (const Element &a, const Element &b) const=0
virtual const ElementMultiplicativeInverse (const Element &a) const=0
virtual const ElementSquare (const Element &a) const
virtual const ElementDivide (const Element &a, const Element &b) const
virtual Element Exponentiate (const Element &a, const Integer &e) const
virtual Element CascadeExponentiate (const Element &x, const Integer &e1, const Element &y, const Integer &e2) const
virtual const AbstractGroup<
Integer > & 
MultiplicativeGroup () const
virtual bool Equal (const Element &a, const Element &b) const=0
virtual const ElementAdd (const Element &a, const Element &b) const=0
virtual const ElementInverse (const Element &a) const=0
virtual bool InversionIsFast () const
virtual const ElementDouble (const Element &a) const
virtual const ElementSubtract (const Element &a, const Element &b) const
virtual ElementAccumulate (Element &a, const Element &b) const
virtual ElementReduce (Element &a, const Element &b) const
virtual Element ScalarMultiply (const Element &a, const Integer &e) const
virtual Element CascadeScalarMultiply (const Element &x, const Integer &e1, const Element &y, const Integer &e2) const
virtual void SimultaneousMultiply (Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const

Static Public Attributes

const RandomizationParameter DefaultRandomizationParameter

Protected Attributes

Integer modulus
Integer result
Integer result1


The documentation for this class was generated from the following files:
Generated on Wed Jul 21 19:15:58 2004 for Crypto++ by doxygen 1.3.7-20040704