Crypto++ 8.7
Free C++ class library of cryptographic schemes
|
represents single-variable polynomials over arbitrary rings More...
#include <polynomi.h>
Classes | |
class | DivideByZero |
division by zero exception More... | |
class | RandomizationParameter |
specify the distribution for randomization functions More... | |
ENUMS, EXCEPTIONS, and TYPEDEFS | |
typedef T | Ring |
typedef T::Element | CoefficientType |
INPUT/OUTPUT | |
std::istream & | Input (std::istream &in, const Ring &ring) |
std::ostream & | Output (std::ostream &out, const Ring &ring) const |
CREATORS | |
PolynomialOver () | |
creates the zero polynomial More... | |
PolynomialOver (const Ring &ring, unsigned int count) | |
PolynomialOver (const PolynomialOver< Ring > &t) | |
copy constructor More... | |
PolynomialOver (const CoefficientType &element) | |
construct constant polynomial More... | |
template<typename Iterator > | |
PolynomialOver (Iterator begin, Iterator end) | |
construct polynomial with specified coefficients, starting from coefficient of x^0 More... | |
PolynomialOver (const char *str, const Ring &ring) | |
convert from string More... | |
PolynomialOver (const byte *encodedPolynomialOver, unsigned int byteCount) | |
convert from big-endian byte array | |
PolynomialOver (const byte *BEREncodedPolynomialOver) | |
convert from Basic Encoding Rules encoded byte array | |
PolynomialOver (BufferedTransformation &bt) | |
convert from BER encoded byte array stored in a BufferedTransformation object | |
PolynomialOver (RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring) | |
create a random PolynomialOver<T> More... | |
ACCESSORS | |
int | Degree (const Ring &ring) const |
the zero polynomial will return a degree of -1 More... | |
unsigned int | CoefficientCount (const Ring &ring) const |
CoefficientType | GetCoefficient (unsigned int i, const Ring &ring) const |
return coefficient for x^i More... | |
MANIPULATORS | |
PolynomialOver< Ring > & | operator= (const PolynomialOver< Ring > &t) |
void | Randomize (RandomNumberGenerator &rng, const RandomizationParameter ¶meter, const Ring &ring) |
void | SetCoefficient (unsigned int i, const CoefficientType &value, const Ring &ring) |
set the coefficient for x^i to value More... | |
void | Negate (const Ring &ring) |
void | swap (PolynomialOver< Ring > &t) |
BASIC ARITHMETIC ON POLYNOMIALS | |
bool | Equals (const PolynomialOver< Ring > &t, const Ring &ring) const |
bool | IsZero (const Ring &ring) const |
PolynomialOver< Ring > | Plus (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Minus (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Inverse (const Ring &ring) const |
PolynomialOver< Ring > | Times (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | DividedBy (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Modulo (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | MultiplicativeInverse (const Ring &ring) const |
bool | IsUnit (const Ring &ring) const |
PolynomialOver< Ring > & | Accumulate (const PolynomialOver< Ring > &t, const Ring &ring) |
PolynomialOver< Ring > & | Reduce (const PolynomialOver< Ring > &t, const Ring &ring) |
PolynomialOver< Ring > | Doubled (const Ring &ring) const |
PolynomialOver< Ring > | Squared (const Ring &ring) const |
CoefficientType | EvaluateAt (const CoefficientType &x, const Ring &ring) const |
PolynomialOver< Ring > & | ShiftLeft (unsigned int n, const Ring &ring) |
PolynomialOver< Ring > & | ShiftRight (unsigned int n, const Ring &ring) |
static void | Divide (PolynomialOver< Ring > &r, PolynomialOver< Ring > &q, const PolynomialOver< Ring > &a, const PolynomialOver< Ring > &d, const Ring &ring) |
calculate r and q such that (a == d*q + r) && (0 <= degree of r < degree of d) More... | |
represents single-variable polynomials over arbitrary rings
Definition at line 21 of file polynomi.h.
typedef T PolynomialOver< T >::Ring |
Definition at line 46 of file polynomi.h.
typedef T::Element PolynomialOver< T >::CoefficientType |
Definition at line 47 of file polynomi.h.
|
inline |
creates the zero polynomial
Definition at line 53 of file polynomi.h.
|
inline |
Definition at line 56 of file polynomi.h.
|
inline |
copy constructor
Definition at line 60 of file polynomi.h.
|
inline |
construct constant polynomial
Definition at line 64 of file polynomi.h.
|
inline |
construct polynomial with specified coefficients, starting from coefficient of x^0
Definition at line 68 of file polynomi.h.
|
inline |
convert from string
Definition at line 72 of file polynomi.h.
|
inline |
create a random PolynomialOver<T>
Definition at line 84 of file polynomi.h.
|
inline |
the zero polynomial will return a degree of -1
Definition at line 91 of file polynomi.h.
unsigned int PolynomialOver< T >::CoefficientCount | ( | const Ring & | ring | ) | const |
Definition at line 76 of file polynomi.cpp.
PolynomialOver< T >::CoefficientType PolynomialOver< T >::GetCoefficient | ( | unsigned int | i, |
const Ring & | ring | ||
) | const |
return coefficient for x^i
Definition at line 86 of file polynomi.cpp.
PolynomialOver< T > & PolynomialOver< T >::operator= | ( | const PolynomialOver< Ring > & | t | ) |
Definition at line 92 of file polynomi.cpp.
void PolynomialOver< T >::Randomize | ( | RandomNumberGenerator & | rng, |
const RandomizationParameter & | parameter, | ||
const Ring & | ring | ||
) |
Definition at line 16 of file polynomi.cpp.
void PolynomialOver< T >::SetCoefficient | ( | unsigned int | i, |
const CoefficientType & | value, | ||
const Ring & | ring | ||
) |
set the coefficient for x^i to value
Definition at line 182 of file polynomi.cpp.
void PolynomialOver< T >::Negate | ( | const Ring & | ring | ) |
Definition at line 190 of file polynomi.cpp.
void PolynomialOver< T >::swap | ( | PolynomialOver< Ring > & | t | ) |
Definition at line 198 of file polynomi.cpp.
bool PolynomialOver< T >::Equals | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) | const |
Definition at line 204 of file polynomi.cpp.
|
inline |
Definition at line 120 of file polynomi.h.
PolynomialOver< T > PolynomialOver< T >::Plus | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) | const |
Definition at line 219 of file polynomi.cpp.
PolynomialOver< T > PolynomialOver< T >::Minus | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) | const |
Definition at line 250 of file polynomi.cpp.
PolynomialOver< T > PolynomialOver< T >::Inverse | ( | const Ring & | ring | ) | const |
Definition at line 281 of file polynomi.cpp.
PolynomialOver< T > PolynomialOver< T >::Times | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) | const |
Definition at line 293 of file polynomi.cpp.
PolynomialOver< T > PolynomialOver< T >::DividedBy | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) | const |
Definition at line 309 of file polynomi.cpp.
PolynomialOver< T > PolynomialOver< T >::Modulo | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) | const |
Definition at line 317 of file polynomi.cpp.
PolynomialOver< T > PolynomialOver< T >::MultiplicativeInverse | ( | const Ring & | ring | ) | const |
Definition at line 325 of file polynomi.cpp.
bool PolynomialOver< T >::IsUnit | ( | const Ring & | ring | ) | const |
Definition at line 331 of file polynomi.cpp.
PolynomialOver< T > & PolynomialOver< T >::Accumulate | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) |
Definition at line 104 of file polynomi.cpp.
PolynomialOver< T > & PolynomialOver< T >::Reduce | ( | const PolynomialOver< Ring > & | t, |
const Ring & | ring | ||
) |
Definition at line 118 of file polynomi.cpp.
|
inline |
Definition at line 136 of file polynomi.h.
|
inline |
Definition at line 138 of file polynomi.h.
PolynomialOver< T >::CoefficientType PolynomialOver< T >::EvaluateAt | ( | const CoefficientType & | x, |
const Ring & | ring | ||
) | const |
Definition at line 132 of file polynomi.cpp.
PolynomialOver< T > & PolynomialOver< T >::ShiftLeft | ( | unsigned int | n, |
const Ring & | ring | ||
) |
Definition at line 149 of file polynomi.cpp.
PolynomialOver< T > & PolynomialOver< T >::ShiftRight | ( | unsigned int | n, |
const Ring & | ring | ||
) |
Definition at line 167 of file polynomi.cpp.
|
static |
calculate r and q such that (a == d*q + r) && (0 <= degree of r < degree of d)
Definition at line 430 of file polynomi.cpp.
std::istream & PolynomialOver< T >::Input | ( | std::istream & | in, |
const Ring & | ring | ||
) |
Definition at line 337 of file polynomi.cpp.
std::ostream & PolynomialOver< T >::Output | ( | std::ostream & | out, |
const Ring & | ring | ||
) | const |
Definition at line 370 of file polynomi.cpp.