ENUMS, EXCEPTIONS, and TYPEDEFS |
| typedef unsigned int | RandomizationParameter |
CREATORS |
| | PolynomialMod2 () |
| | creates the zero polynomial. More...
|
| | PolynomialMod2 (const PolynomialMod2 &t) |
| | copy constructor. More...
|
| | PolynomialMod2 (word value,unsigned int bitLength=WORD_BITS) |
| | convert from word. More...
|
| | PolynomialMod2 (const byte *encodedPoly,unsigned int byteCount) |
| | convert from big-endian byte array. More...
|
| | PolynomialMod2 (BufferedTransformation &encodedPoly,unsigned int byteCount) |
| | convert from big-endian form stored in a BufferedTransformation. More...
|
| | PolynomialMod2 (RandomNumberGenerator &rng,unsigned int bitcount) |
| | create a random polynomial uniformly distributed over all polynomials with degree less than bitcount. More...
|
| PolynomialMod2 | Monomial (unsigned i) |
| | return x^i. More...
|
| PolynomialMod2 | Trinomial (unsigned t0,unsigned t1,unsigned t2) |
| | return x^t0 + x^t1 + x^t2. More...
|
| PolynomialMod2 | Pentanomial (unsigned t0,unsigned t1,unsigned t2,unsigned int t3,unsigned int t4) |
| | return x^t0 + x^t1 + x^t2 + x^t3 + x^t4. More...
|
| PolynomialMod2 | AllOnes (unsigned n) |
| | return x^(n-1) + ... + x + 1. More...
|
| const PolynomialMod2& | Zero () |
| const PolynomialMod2& | One () |
ENCODE/DECODE |
| unsigned int | MinEncodedSize ()const |
| | minimum number of bytes to encode this polynomial. More...
|
| unsigned int | Encode (byte *output,unsigned int outputLen)const |
| | encode in big-endian format. More...
|
| unsigned int | Encode (BufferedTransformation &bt,unsigned int outputLen)const |
| void | Decode (const byte *input,unsigned int inputLen) |
| void | Decode (BufferedTransformation &bt,unsigned int inputLen) |
| void | DEREncodeAsOctetString (BufferedTransformation &bt,unsigned int length)const |
| | encode value as big-endian octet string. More...
|
| void | BERDecodeAsOctetString (BufferedTransformation &bt,unsigned int length) |
| | decode value as big-endian octet string. More...
|
ACCESSORS |
| unsigned int | BitCount ()const |
| | number of significant bits = Degree() + 1. More...
|
| unsigned int | ByteCount ()const |
| | number of significant bytes = ceiling(BitCount()/8). More...
|
| unsigned int | WordCount ()const |
| | number of significant words = ceiling(ByteCount()/sizeof(word)). More...
|
| bool | GetBit (unsigned int n)const |
| | return the n-th bit, n=0 being the least significant bit. More...
|
| byte | GetByte (unsigned int n)const |
| | return the n-th byte. More...
|
| signed int | Degree ()const |
| | the zero polynomial will return a degree of -1. More...
|
| unsigned int | CoefficientCount ()const |
| | degree + 1. More...
|
| int | GetCoefficient (unsigned int i)const |
| | return coefficient for x^i. More...
|
| int | operator[] (unsigned int i)const |
| | return coefficient for x^i. More...
|
| bool | IsZero ()const |
| bool | Equals (const PolynomialMod2 &rhs)const |
MANIPULATORS |
| PolynomialMod2& | operator= (const PolynomialMod2 &t) |
|
PolynomialMod2& | operator &= (const PolynomialMod2 &t) |
| PolynomialMod2& | operator^= (const PolynomialMod2 &t) |
| PolynomialMod2& | operator+= (const PolynomialMod2 &t) |
| PolynomialMod2& | operator-= (const PolynomialMod2 &t) |
|
PolynomialMod2& | operator *= (const PolynomialMod2 &t) |
|
PolynomialMod2& | operator/= (const PolynomialMod2 &t) |
|
PolynomialMod2& | operator%= (const PolynomialMod2 &t) |
| PolynomialMod2& | operator<<= (unsigned int) |
| PolynomialMod2& | operator>>= (unsigned int) |
| void | Randomize (RandomNumberGenerator &rng,unsigned int bitcount) |
| void | SetBit (unsigned int i,int value=1) |
| void | SetByte (unsigned int n,byte value) |
| | set the n-th byte to value. More...
|
| void | SetCoefficient (unsigned int i,int value) |
| void | swap (PolynomialMod2 &a) |
UNARY OPERATORS |
| bool | operator! ()const |
| PolynomialMod2 | operator+ ()const |
| PolynomialMod2 | operator- ()const |
BINARY OPERATORS |
| PolynomialMod2 | And (const PolynomialMod2 &b)const |
| PolynomialMod2 | Xor (const PolynomialMod2 &b)const |
| PolynomialMod2 | Plus (const PolynomialMod2 &b)const |
| PolynomialMod2 | Minus (const PolynomialMod2 &b)const |
| PolynomialMod2 | Times (const PolynomialMod2 &b)const |
| PolynomialMod2 | DividedBy (const PolynomialMod2 &b)const |
| PolynomialMod2 | Modulo (const PolynomialMod2 &b)const |
| PolynomialMod2 | operator>> (unsigned int n)const |
| PolynomialMod2 | operator<< (unsigned int n)const |
OTHER ARITHMETIC FUNCTIONS |
| unsigned int | Parity ()const |
| | sum modulo 2 of all coefficients. More...
|
| bool | IsIrreducible ()const |
| | check for irreducibility. More...
|
| PolynomialMod2 | Doubled ()const |
| | is always zero since we're working modulo 2. More...
|
| PolynomialMod2 | Squared ()const |
| bool | IsUnit ()const |
| | only 1 is a unit. More...
|
| PolynomialMod2 | MultiplicativeInverse ()const |
| | return inverse if *this is a unit, otherwise return 0. More...
|
|
PolynomialMod2 | InverseMod (const PolynomialMod2 &)const |
| | calculate multiplicative inverse of *this mod n.
|
| PolynomialMod2 | Gcd (const PolynomialMod2 &a,const PolynomialMod2 &n) |
| | greatest common divisor. More...
|
| void | Divide (PolynomialMod2 &r,PolynomialMod2 &q,const PolynomialMod2 &a,const PolynomialMod2 &d) |
| | calculate r and q such that (a == d*q + r) && (deg(r) < deg(d)). More...
|
INPUT/OUTPUT |
| class | operator<< |
Friends |
| class | GF2NT |