How to represent a binary field in a programming language?

I am working on my Elliptic Curve Cryptography project, which requires binary programming. It includes basic operations such as addition, multiplication, inversion, etc. Wrt irreducible binary polynomial.

I am looking for a way in which these binary polynomials can be stored in a program. I am working on the C and C ++ programming language (with the gmp library), so it occurred to me to use structures and bit fields. But they are not dynamic and cannot contain arbitrarily large polynomials. Using C ++ Vector STL is possible, but it will not be effective because it stores one bit in one word of 8 or more bits.

Is there a way to present effectively?

+6
source share
1 answer

It is IMPOSSIBLE to store bitwise data in an array. If I were you, I would save the bit information in a large UNSIGNED LONG INTEGER and write a function that can get and put bits into and out of this integer value cluster. This method of storing bit information will accelerate your decision up to 64 times!

0
source

All Articles