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

# MontgomeryRepresentation Class Reference

`#include <modarith.h>`

Inheritance diagram for MontgomeryRepresentation:

List of all members.

## Detailed Description

do modular arithmetics in Montgomery representation for increased speed

Note:
  the Montgomery representation represents each congruence class [a] as a*r%n, where r is a convenient power of 2

Definition at line 122 of file modarith.h.

## Public Types
typedef int | RandomizationParameter
typedef Integer | Element
## Public Member Functions
| MontgomeryRepresentation (const Integer &modulus)
virtual ModularArithmetic * | Clone () const
bool | IsMontgomeryRepresentation () const
Integer | ConvertIn (const Integer &a) const
Integer | ConvertOut (const Integer &a) const
const Integer & | MultiplicativeIdentity () const
const Integer & | Multiply (const Integer &a, const Integer &b) const
const Integer & | Square (const Integer &a) const
const Integer & | MultiplicativeInverse (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
void | DEREncode (BufferedTransformation &bt) const
void | DEREncodeElement (BufferedTransformation &out, const Element &a) const
void | BERDecodeElement (BufferedTransformation &in, Element &a) const
const Integer & | GetModulus () const
void | SetModulus (const Integer &newModulus)
const Integer & | Half (const Integer &a) const
bool | Equal (const Integer &a, const Integer &b) const
virtual bool | Equal (const Element &a, const Element &b) const=0
const Integer & | Identity () const
const Integer & | Add (const Integer &a, const Integer &b) const
virtual const Element & | Add (const Element &a, const Element &b) const=0
Integer & | Accumulate (Integer &a, const Integer &b) const
virtual Element & | Accumulate (Element &a, const Element &b) const
const Integer & | Inverse (const Integer &a) const
virtual const Element & | Inverse (const Element &a) const=0
const Integer & | Subtract (const Integer &a, const Integer &b) const
virtual const Element & | Subtract (const Element &a, const Element &b) const
Integer & | Reduce (Integer &a, const Integer &b) const
virtual Element & | Reduce (Element &a, const Element &b) const
const Integer & | Double (const Integer &a) const
virtual const Element & | Double (const Element &a) const
virtual const Element & | Multiply (const Element &a, const Element &b) const=0
virtual const Element & | Square (const Element &a) const
bool | IsUnit (const Integer &a) const
virtual bool | IsUnit (const Element &a) const=0
virtual const Element & | MultiplicativeInverse (const Element &a) const=0
const Integer & | Divide (const Integer &a, const Integer &b) const
virtual const Element & | Divide (const Element &a, const Element &b) const
virtual Element | CascadeExponentiate (const Element &x, const Integer &e1, const Element &y, const Integer &e2) 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 Element | Exponentiate (const Element &a, const Integer &e) const
virtual const AbstractGroup< Integer > & | MultiplicativeGroup () const
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
## 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:

- modarith.h
- integer.cpp