Crypto++  8.8
Free C++ class library of cryptographic schemes
Classes | Public Types | List of all members
PolynomialOverFixedRing< T, instance > Class Template Reference

Polynomials over a fixed ring. More...

+ Inheritance diagram for PolynomialOverFixedRing< T, instance >:

Public Types

typedef T Ring
 
typedef T::Element CoefficientType
 
typedef B::DivideByZero DivideByZero
 
typedef B::RandomizationParameter RandomizationParameter
 

Public Member Functions

ACCESSORS
int Degree () const
 the zero polynomial will return a degree of -1
 
unsigned int CoefficientCount () const
 degree + 1
 
CoefficientType GetCoefficient (unsigned int i) const
 return coefficient for x^i
 
CoefficientType operator[] (unsigned int i) const
 return coefficient for x^i
 
MANIPULATORS
ThisTypeoperator= (const ThisType &t)
 
ThisTypeoperator+= (const ThisType &t)
 
ThisTypeoperator-= (const ThisType &t)
 
ThisTypeoperator*= (const ThisType &t)
 
ThisTypeoperator/= (const ThisType &t)
 
ThisTypeoperator%= (const ThisType &t)
 
ThisTypeoperator<<= (unsigned int n)
 
ThisTypeoperator>>= (unsigned int n)
 
void SetCoefficient (unsigned int i, const CoefficientType &value)
 set the coefficient for x^i to value
 
void Randomize (RandomNumberGenerator &rng, const RandomizationParameter &parameter)
 
void Negate ()
 
void swap (ThisType &t)
 
UNARY OPERATORS
bool operator! () const
 
ThisType operator+ () const
 
ThisType operator- () const
 

Friends

BINARY OPERATORS
ThisType operator>> (ThisType a, unsigned int n)
 
ThisType operator<< (ThisType a, unsigned int n)
 

INPUT/OUTPUT

std::istream & operator>> (std::istream &in, ThisType &a)
 
std::ostream & operator<< (std::ostream &out, const ThisType &a)
 

CREATORS

 PolynomialOverFixedRing (unsigned int count=0)
 creates the zero polynomial
 
 PolynomialOverFixedRing (const ThisType &t)
 copy constructor
 
 PolynomialOverFixedRing (const B &t)
 
 PolynomialOverFixedRing (const CoefficientType &element)
 construct constant polynomial
 
template<typename Iterator >
 PolynomialOverFixedRing (Iterator first, Iterator last)
 construct polynomial with specified coefficients, starting from coefficient of x^0
 
 PolynomialOverFixedRing (const char *str)
 convert from string
 
 PolynomialOverFixedRing (const byte *encodedPoly, unsigned int byteCount)
 convert from big-endian byte array
 
 PolynomialOverFixedRing (const byte *BEREncodedPoly)
 convert from Basic Encoding Rules encoded byte array
 
 PolynomialOverFixedRing (BufferedTransformation &bt)
 convert from BER encoded byte array stored in a BufferedTransformation object
 
 PolynomialOverFixedRing (RandomNumberGenerator &rng, const RandomizationParameter &parameter)
 create a random PolynomialOverFixedRing
 
static const ThisTypeZero ()
 
static const ThisTypeOne ()
 

OTHER ARITHMETIC FUNCTIONS

ThisType MultiplicativeInverse () const
 
bool IsUnit () const
 
ThisType Doubled () const
 
ThisType Squared () const
 
CoefficientType EvaluateAt (const CoefficientType &x) const
 
static void Divide (ThisType &r, ThisType &q, const ThisType &a, const ThisType &d)
 calculate r and q such that (a == d*q + r) && (0 <= r < abs(d))
 

Detailed Description

template<class T, int instance>
class PolynomialOverFixedRing< T, instance >

Polynomials over a fixed ring.

Having a fixed ring allows overloaded operators

Definition at line 163 of file polynomi.h.


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