General
I'm looking for a library that is able to do exact calculations on large finite fields such as GF(2128)/2128 and GF(2256)/2256. I listed the features that I need and the features that would be cool below. Obviously, the library should be as fast as possible :-). Ah, since I'm no C++ master (and probably most of the libraries are C++), sample code of say generate a random element/a constant and multiply it to it's multiplicative inverse
Must-Have Features
- Addition of field elements
- Multiplication of field element
- Find the multiplicative inverse of a field element
Nice to Have Features
- Vector/Matrix support
- Random Element support
Libraries I already looked at that will probably not work
- FFLAS/FFPACK, seems not to work with such large finite fields
- Givaro, seems not to work on such large finite fields
Libraries I already looked at that could work (but I was unable to use)
NTL, I was not able to invert an element, but it should really work since SAGE seems to use this library when defining GF(2^256) and there an element can be inverted usingx^(-1)
- PARI/GP, I was not able to find everything I need in the documentation, but the SAGE documentation kind of says that it should work
Other notes
- I'm writing a Haskell program and will interface that library later, so easier Haskell interfacing is better :-)
The NTL library seems to work, using this (sorry I'm quite unable to program in C++) code
it seems to work, proof (output of this program):
Even inverting seems to work (scroll as right as possible in the output sample above) :-)