Bill Allombert on Sat, 02 Apr 2011 19:16:49 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: ECC modelling


On Sat, Apr 02, 2011 at 04:29:06PM +0200, Bill Allombert wrote:
> On Sat, Apr 02, 2011 at 04:41:43PM +0300, Eugene N wrote:
> > Hello Sirs
> > 
> > I am a student and i recently decided to use this renound tool for the
> > purpose of ECC modelling.
> > I browsed through the manuals & did some web searcehes (
> > http://orion.math.iastate.edu/cbergman/crypto/pari/parihelp.html)
> > and i am very happy to discover this great tool.
> > 
> > However, i stumbled upon some problems, wich made me turn for advice to
> > expirienced users like you. I hope you will clear som things for me.
> > 
> > I am looking for a way to generate n-nomials (generators of m.gr. inGF(2^m)
> > ), especially tri-and pentanomials. I have read about ffinit(p,n) - but it
> > produces
> > long polies.
> 
> There are no functions in PARI to generate irreducible trinomials or pentanomials.
> but you can program it in GP easily:
> 
> trino(N)=for(i=1,N-1,P=x^N+x^i+1;if(polisirreducible(P*Mod(1,2)),return(P)))
> penta(N)=forvec(v=vector(3,i,[1,N-1]),P=x^N+1+sum(i=1,3,x^v[i]);if(polisirreducible(P*Mod(1,2)),return(P)))

Actually I meant to write
penta(N)=forvec(v=vector(3,i,[1,N-1]),P=x^N+1+sum(i=1,3,x^v[i]);if(polisirreducible(P*Mod(1,2)),return(P)),2)

Both are correct but the second is faster.

Cheers,
Bill.