[ntl] Iterating over all elements of a finite field
Andreas Krinke
andreas.krinke at gmx.de
Mon Jan 4 10:53:31 CST 2010
Hello!
First of all, thank you for this great library!
I'm using NTL to create the finite field with 8 elements like that:
unsigned p = 2;
unsigned n = 3;
ZZ_p::init(to_ZZ(p));
ZZ_pX P;
BuildIrred(P, n);
ZZ_pE::init(P);
How can I iterate over all elements of this field? I tried to use a
ZZ_pX to create all possible polynomials from GF(p)[X] and then convert
them to ZZ_pE via conv. However, then inversion gives an error:
ZZ_pX polynomial;
poly.rep.SetLength(n);
poly.rep[0] = 1;
ZZ_pE e;
conv(e, poly) // --> e == [1 0 0]
inv(e); // error: ZZ_p: division by zero
How is this done correctly?
Thank you for your time.
Regards,
Andreas
More information about the ntl
mailing list