Classes | |
struct | bitset_base |
Base class of libecc::bitset. 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_index |
A bitset index. More... | |
class | bitset_index_iterator |
A bitset index with increment/decrement methods. More... | |
class | bitset_iterator |
A non-mutable bitset-iterator. More... | |
class | bitset |
A bitset with a fixed number of bits. More... | |
struct | assign |
Operation used with libecc::bitset::shift_op. 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... | |
class | polynomial |
Polynomial representation of the Galois field F2m. More... | |
class | point |
Point (x,y) on elliptic curve x3 + ax2 + b = y2 + xy. 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 &, bitset_index_iterator< DIRECTION > const &) |
Less. | |
template<int DIRECTION> bool | operator> (bitset_index_iterator< DIRECTION > const &, bitset_index_iterator< DIRECTION > const &) |
Greater. | |
template<int DIRECTION> bool | operator<= (bitset_index_iterator< DIRECTION > const &, bitset_index_iterator< DIRECTION > const &) |
Less or equal. | |
template<int DIRECTION> bool | operator>= (bitset_index_iterator< DIRECTION > const &, bitset_index_iterator< DIRECTION > const &) |
Greater or equal. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator+ (bitset_iterator< n, DIRECTION > const &, int) |
Iterator addition. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator+ (int, bitset_iterator< n, DIRECTION > const &) |
Iterator addition. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator- (bitset_iterator< n, DIRECTION > const &, int) |
Iterator subtraction. | |
template<unsigned int n, int DIRECTION> bitset_iterator< n, DIRECTION > | operator- (int, bitset_iterator< n, DIRECTION > const &) |
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, unsigned int k1, unsigned int k2> polynomial< m, k, k1, k2 > | operator * (polynomial< m, k, k1, k2 > const &, polynomial< m, k, k1, k2 > const &) |
template<unsigned int m, unsigned int k, unsigned int k1, unsigned int k2> polynomial< m, k, k1, k2 > | operator/ (polynomial< m, k, k1, k2 > const &, polynomial< m, k, k1, k2 > const &) |
template<unsigned int m, unsigned int k, unsigned int k1, unsigned int k2> bool | operator== (polynomial< m, k, k1, k2 > const &, polynomial< m, k, k1, k2 > const &) |
template<unsigned int m, unsigned int k, unsigned int k1, unsigned int k2> bool | operator!= (polynomial< m, k, k1, k2 > const &, polynomial< m, k, k1, k2 > const &) |
template<unsigned int m, unsigned int k, unsigned int k1, unsigned int k2> std::ostream & | operator<< (std::ostream &, polynomial< m, k, k1, k2 > const &) |
template<unsigned int m, unsigned int k, unsigned int k1, unsigned int k2> polynomial< m, k, k1, k2 >::xor_type | operator+ (polynomial< m, k, k1, k2 > const &, polynomial< m, k, k1, k2 > const &) |
template<unsigned int m, unsigned int k, unsigned int k1, unsigned int k2> polynomial< m, k, k1, k2 >::xor_type | operator- (polynomial< m, k, k1, k2 > const &, polynomial< m, k, k1, k2 > const &) |
template<class field_type, class square_functor> field_type | exponentiation (field_type const &base, mpz_class const &exponent, square_functor const &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:
and then use
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. Note that it is not possible to write:
There is a complicated reason for that. Instead, write
For example, when adding a whole series of polynomials you'd do:
Basically, it is not supported to add or substract a polynomial to or from a temporary that represents an addition or subtraction by itself. |
|
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:
|
|
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:
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:
will only run once over the digits of both bitset and compare the digits once by one using |