[ntl] Iterating over all elements of a finite field

Andreas Krinke andreas.krinke at gmx.de
Mon Jan 4 12:29:15 CST 2010


Andreas Krinke wrote:

> ZZ_pX poly;
> 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

It seems to fail because of the higher coefficients being zero. I solved
it by creating polynomials with one as the highest coefficient.

For GF(2^3) the sequence is

[1]
[0 1]
[1 1]
[0 0 1]
[1 0 1]
[0 1 1]
[1 1 1]

The inversion after conversion to ZZ_pE works now.

Regards,
Andreas



More information about the ntl mailing list