Compounds | |
struct | assign |
Operation used with libecc::bitset::shift_op. More... | |
class | polynomial |
Polynomial representation of the Galois Field ![]() | |
class | bitset |
A bitset with a fixed number of bits. More... | |
struct | bitset_base |
Base class of libecc::bitset. More... | |
class | bitset_index |
A bitset index. More... | |
class | bitset_index_iterator |
A bitset index with increment/decrement methods. More... | |
class | bitset_invertible |
A bitset with a fixed number of bits, having possibly an infinite number of leading virtual 1's. More... | |
class | bitset_iterator |
A non-mutable bitset-iterator. More... | |
struct | exor |
Operation used with libecc::bitset::shift_op. More... | |
struct | left |
Shift direction used with libecc::bitset::shift_op. More... | |
struct | right |
Shift direction used with libecc::bitset::shift_op. More... | |
class | rng |
Pseudo Random Number Generator. More... | |
class | sha1 |
SHA-1. More... | |
Typedefs | |
typedef unsigned long | bitset_digit_t |
Internal data type, used to store the bits of class bitset. | |
Functions | |
template<unsigned int n, bool inverted> bitset_invertible< n,!inverted > const & | operator~ (bitset_invertible< n, inverted > const &bits) |
Invert a bitset. | |
bool | operator== (bitset_index const &i1, bitset_index const &i2) |
Equality operator. | |
bool | operator!= (bitset_index const &i1, bitset_index const &i2) |
Inequality operator. | |
template<int DIRECTION> bool | operator< (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2) |
Less. | |
template<int DIRECTION> bool | operator> (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2) |
Greater. | |
template<int DIRECTION> bool | operator<= (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2) |
Less or equal. | |
template<int DIRECTION> bool | operator>= (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2) |
Greater or equal. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator+ (bitset_iterator< n, DIRECTION > const &i, int d) |
Iterator addition. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator+ (int d, bitset_iterator< n, DIRECTION > const &i) |
Iterator addition. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator- (bitset_iterator< n, DIRECTION > const &i, int d) |
Iterator subtraction. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator- (int d, bitset_iterator< n, DIRECTION > const &i) |
Iterator subtraction. | |
template<unsigned int n1, bool inverted1, unsigned int n2, bool inverted2> bool | operator== (bitset_invertible< n1, inverted1 > const &bits1, bitset_invertible< n2, inverted2 > const &bits2) |
Equivalence operator. | |
template<unsigned int n1, bool inverted1, unsigned int n2, bool inverted2> bool | operator!= (bitset_invertible< n1, inverted1 > const &bits1, bitset_invertible< n2, inverted2 > const &bits2) |
Unequivalence operator. | |
template<unsigned int m, bool inverted1, bool inverted2> Operator::bitsetExpression< m, inverted1, inverted2, Operator::bitsetAND > | operator & (bitset_invertible< m, inverted1 > const &arg1, bitset_invertible< m, inverted2 > const &arg2) |
Assignment operator with bitwise AND for expressions. | |
template<unsigned int m, bool inverted1, bool inverted2> Operator::bitsetExpression< m, inverted1, inverted2, Operator::bitsetOR > | operator| (bitset_invertible< m, inverted1 > const &arg1, bitset_invertible< m, inverted2 > const &arg2) |
Assignment operator with bitwise OR for expressions. | |
template<unsigned int m, bool inverted1, bool inverted2> Operator::bitsetExpression< m, inverted1, inverted2, Operator::bitsetXOR > | operator^ (bitset_invertible< m, inverted1 > const &arg1, bitset_invertible< m, inverted2 > const &arg2) |
Assignment operator with bitwise XOR for expressions. | |
template<unsigned int n> std::istream & | operator>> (std::istream &is, bitset< n > &bitsetx) |
Read bitset from istream. | |
template<unsigned int n> std::ostream & | operator<< (std::ostream &os, bitset< n > const &bits) |
Write bitset to ostream. | |
template<unsigned int m, unsigned int k> bool | operator== (polynomial< m, k > const &p1, polynomial< m, k > const &p2) |
template<unsigned int m, unsigned int k> bool | operator!= (polynomial< m, k > const &p1, polynomial< m, k > const &p2) |
template<unsigned int m, unsigned int k> Operator::bitsetExpression< m, false, false, Operator::bitsetXOR > | operator+ (polynomial< m, k > const &p1, polynomial< m, k > const &p2) |
template<unsigned int m, unsigned int k> Operator::bitsetExpression< m, false, false, Operator::bitsetXOR > | operator- (polynomial< m, k > const &p1, polynomial< m, k > const &p2) |
template<unsigned int m, unsigned int k> polynomial< m, k > | operator * (polynomial< m, k > const &p1, polynomial< m, k > const &p2) |
template<unsigned int m, unsigned int k> polynomial< m, k > | operator/ (polynomial< m, k > const &e1, polynomial< m, k > const &e2) |
template<unsigned int m, unsigned int k> std::ostream & | operator<< (std::ostream &os, polynomial< m, k > const &p) |
template<class field_type, class square_functor> field_type | exponentiation (field_type const &base, mpz_class const &exponent, square_functor &do_square=multiplicative_square< field_type >()) |
template<unsigned int m> bitset< m > & | gcd (bitset< m > &polynomial_coefficients0, bitset< m > &polynomial_coefficients1) |
|
Internal data type, used to store the bits of class bitset.
The number of bits in the builtin-type |
|
Calculates the exponentiation of an arbitrary field element. The field must have defined the methods
void operator()(field_type &x) setting x to its square.
For example for a libecc::polynomial:
template<unsigned int m, unsigned int k> class polynomial_square { libecc::bitset_digit_t buffer[libecc::polynomial<m, k>::square_digits]; public: void operator()(libecc::polynomial<m, k>& p) const { p = p.square(buffer); } }; and then use
libecc::polynomial<m, k> power(exponentiation(base, exponent, polynomial_square<m, k>()));
The default functor multiplicative_square uses
|
|
Calculates the Greatest Common Denominator of two polynomials over
|
|
Assignment operator with bitwise AND for expressions.
|
|
Multiply polynomial p1 with polynomial p2. |
|
Compare two polynomials. Returns |
|
Unequivalence operator.
|
|
Inequality operator.
|
|
Prepare the addition of two polynomials. Returns a dummy object with two pointers to the polynomials to be added. The addition does not take place until the final destination polynomial is known as well. |
|
Iterator addition.
|
|
Iterator addition.
|
|
Prepare the subtraction of two polynomials. Returns a dummy object with two pointers to the polynomials to be subtracted. The subtraction does not take place until the final destination polynomial is known as well. |
|
Iterator subtraction.
|
|
Iterator subtraction.
|
|
Devide polynomial p1 by polynomial p2. |
|
Less.
|
|
Write the binary coefficients of the polynomial p to os.
For example, an output string |
|
Write bitset to ostream.
|
|
Less or equal.
|
|
Compare two polynomials. Returns |
|
Equivalence operator.
This operator can only compare bitsets and inverted bitsets with eachother. For example:
if (x == ~y) ...
|
|
Equality operator.
|
|
Greater.
|
|
Greater or equal.
|
|
Read bitset from istream.
|
|
Assignment operator with bitwise XOR for expressions.
|
|
Assignment operator with bitwise OR for expressions.
|
|
Invert a bitset. This operator is just a cast and doesn't actually do anything until you assign the expression that it is part of to another bitset. For example:
x = ~y; x ^= ~y & ~z; Both cases will run over the digits of bitset x just once and apply the given formula (and any like it) directly on the digits of the bitsets involved. Inversion can also be used together with the equivalence operators. For example:
if (x == ~y) ...
will only run once over the digits of both bitset and compare the digits once by one using |