Crypto++  5.6.3
Free C++ class library of cryptographic schemes
Public Member Functions | List of all members
MontgomeryRepresentation Class Reference

Performs modular arithmetic in Montgomery representation for increased speed. More...

+ Inheritance diagram for MontgomeryRepresentation:

Public Member Functions

 MontgomeryRepresentation (const Integer &modulus)
 
virtual ModularArithmeticClone () const
 
bool IsMontgomeryRepresentation () const
 
Integer ConvertIn (const Integer &a) const
 
Integer ConvertOut (const Integer &a) const
 
const IntegerMultiplicativeIdentity () const
 
const IntegerMultiply (const Integer &a, const Integer &b) const
 
const IntegerSquare (const Integer &a) const
 
const IntegerMultiplicativeInverse (const Integer &a) 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
 
- Public Member Functions inherited from ModularArithmetic
 ModularArithmetic (const Integer &modulus=Integer::One())
 
 ModularArithmetic (const ModularArithmetic &ma)
 
 ModularArithmetic (BufferedTransformation &bt)
 
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)
 
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
 
bool IsUnit (const Integer &a) const
 
const IntegerDivide (const Integer &a, const Integer &b) 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
 
- Public Member Functions inherited from AbstractRing< Integer >
 AbstractRing (const AbstractRing &source)
 
AbstractRingoperator= (const AbstractRing &source)
 
virtual Element Exponentiate (const Element &a, const Integer &e) const
 
virtual const AbstractGroup< Integer > & MultiplicativeGroup () const
 
- Public Member Functions inherited from AbstractGroup< Integer >
virtual bool InversionIsFast () 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
 

Additional Inherited Members

- Public Types inherited from ModularArithmetic
typedef int RandomizationParameter
 
typedef Integer Element
 
- Public Types inherited from AbstractRing< Integer >
typedef Integer Element
 
- Public Types inherited from AbstractGroup< Integer >
typedef Integer Element
 
- Static Public Attributes inherited from ModularArithmetic
static const RandomizationParameter DefaultRandomizationParameter
 

Detailed Description

Performs modular arithmetic in Montgomery representation for increased speed.

The Montgomery representation represents each congruence class [a] as a*rn, where r is a convenient power of 2.

Definition at line 137 of file modarith.h.


The documentation for this class was generated from the following files: