Crypto++ 8.7
Free C++ class library of cryptographic schemes
|
Polynomials over a fixed ring. More...
#include <polynomi.h>
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 More... | |
unsigned int | CoefficientCount () const |
degree + 1 More... | |
CoefficientType | GetCoefficient (unsigned int i) const |
return coefficient for x^i More... | |
CoefficientType | operator[] (unsigned int i) const |
return coefficient for x^i More... | |
MANIPULATORS | |
ThisType & | operator= (const ThisType &t) |
ThisType & | operator+= (const ThisType &t) |
ThisType & | operator-= (const ThisType &t) |
ThisType & | operator*= (const ThisType &t) |
ThisType & | operator/= (const ThisType &t) |
ThisType & | operator%= (const ThisType &t) |
ThisType & | operator<<= (unsigned int n) |
ThisType & | operator>>= (unsigned int n) |
void | SetCoefficient (unsigned int i, const CoefficientType &value) |
set the coefficient for x^i to value More... | |
void | Randomize (RandomNumberGenerator &rng, const RandomizationParameter ¶meter) |
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 More... | |
PolynomialOverFixedRing (const ThisType &t) | |
copy constructor More... | |
PolynomialOverFixedRing (const B &t) | |
PolynomialOverFixedRing (const CoefficientType &element) | |
construct constant polynomial More... | |
template<typename Iterator > | |
PolynomialOverFixedRing (Iterator first, Iterator last) | |
construct polynomial with specified coefficients, starting from coefficient of x^0 More... | |
PolynomialOverFixedRing (const char *str) | |
convert from string More... | |
PolynomialOverFixedRing (const byte *encodedPoly, unsigned int byteCount) | |
convert from big-endian byte array More... | |
PolynomialOverFixedRing (const byte *BEREncodedPoly) | |
convert from Basic Encoding Rules encoded byte array More... | |
PolynomialOverFixedRing (BufferedTransformation &bt) | |
convert from BER encoded byte array stored in a BufferedTransformation object More... | |
PolynomialOverFixedRing (RandomNumberGenerator &rng, const RandomizationParameter ¶meter) | |
create a random PolynomialOverFixedRing More... | |
static const ThisType & | Zero () |
static const ThisType & | One () |
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)) More... | |
Polynomials over a fixed ring.
Having a fixed ring allows overloaded operators
Definition at line 163 of file polynomi.h.
typedef T PolynomialOverFixedRing< T, instance >::Ring |
Definition at line 169 of file polynomi.h.
typedef T::Element PolynomialOverFixedRing< T, instance >::CoefficientType |
Definition at line 170 of file polynomi.h.
typedef B::DivideByZero PolynomialOverFixedRing< T, instance >::DivideByZero |
Definition at line 171 of file polynomi.h.
typedef B::RandomizationParameter PolynomialOverFixedRing< T, instance >::RandomizationParameter |
Definition at line 172 of file polynomi.h.
|
inline |
creates the zero polynomial
Definition at line 177 of file polynomi.h.
|
inline |
copy constructor
Definition at line 180 of file polynomi.h.
|
inlineexplicit |
Definition at line 182 of file polynomi.h.
|
inline |
construct constant polynomial
Definition at line 185 of file polynomi.h.
|
inline |
construct polynomial with specified coefficients, starting from coefficient of x^0
Definition at line 188 of file polynomi.h.
|
inlineexplicit |
convert from string
Definition at line 192 of file polynomi.h.
|
inline |
convert from big-endian byte array
Definition at line 195 of file polynomi.h.
|
inlineexplicit |
convert from Basic Encoding Rules encoded byte array
Definition at line 198 of file polynomi.h.
|
inlineexplicit |
convert from BER encoded byte array stored in a BufferedTransformation object
Definition at line 201 of file polynomi.h.
|
inline |
create a random PolynomialOverFixedRing
Definition at line 204 of file polynomi.h.
|
static |
Definition at line 566 of file polynomi.cpp.
|
static |
Definition at line 572 of file polynomi.cpp.
|
inline |
the zero polynomial will return a degree of -1
Definition at line 213 of file polynomi.h.
|
inline |
degree + 1
Definition at line 215 of file polynomi.h.
|
inline |
return coefficient for x^i
Definition at line 217 of file polynomi.h.
|
inline |
return coefficient for x^i
Definition at line 219 of file polynomi.h.
|
inline |
Definition at line 225 of file polynomi.h.
|
inline |
Definition at line 227 of file polynomi.h.
|
inline |
Definition at line 229 of file polynomi.h.
|
inline |
Definition at line 231 of file polynomi.h.
|
inline |
Definition at line 233 of file polynomi.h.
|
inline |
Definition at line 235 of file polynomi.h.
|
inline |
Definition at line 238 of file polynomi.h.
|
inline |
Definition at line 240 of file polynomi.h.
|
inline |
set the coefficient for x^i to value
Definition at line 243 of file polynomi.h.
|
inline |
Definition at line 246 of file polynomi.h.
|
inline |
Definition at line 249 of file polynomi.h.
|
inline |
Definition at line 251 of file polynomi.h.
|
inline |
Definition at line 257 of file polynomi.h.
|
inline |
Definition at line 259 of file polynomi.h.
|
inline |
Definition at line 261 of file polynomi.h.
|
inline |
Definition at line 275 of file polynomi.h.
|
inline |
Definition at line 277 of file polynomi.h.
|
inline |
Definition at line 280 of file polynomi.h.
|
inline |
Definition at line 282 of file polynomi.h.
|
inline |
Definition at line 284 of file polynomi.h.
|
inlinestatic |
calculate r and q such that (a == d*q + r) && (0 <= r < abs(d))
Definition at line 287 of file polynomi.h.
Definition at line 267 of file polynomi.h.
Definition at line 269 of file polynomi.h.
|
friend |
Definition at line 294 of file polynomi.h.
|
friend |
Definition at line 297 of file polynomi.h.