I am working on my project of Elliptic Curve Cryptography which requires programming on binary fields. It includes basic operations like addition, multiplication, inversion etc w.r.t. an irreducible binary polynomial.
I am searching for a way by which these binary polynomials can be stored in a program. I am working on C and C++ programming language (with gmp library) so the first thought came to my mind was to use structures and bit-fields. But they are not dynamic and can't hold arbitrarily long polynomials. Using C++ Vector STL is possible but it won't be efficient, as it stores a single bit in a single word of 8 or more bits.
Is there any way of representation which is efficient?
xor
twostd::vector<bool>
s. – Perusalboost::dynamic_bitset
. – Perusal