public static void crearGF(){
		int primitivepol=0,maximo=0;
		gfextend=(int) (Math.pow(2, bits)-1); // gfextend funciona como mascara 
		maximo=(int) (Math.pow(2, (bits-1))-1);
		gf=new int[gfextend];
		inv_alfa=new int[gfextend+1];
		inv_gf=new int[gfextend+1];		
		switch(bits){
			case 3: primitivepol=3;break;
			case 4: primitivepol=3;break;
			case 5:	primitivepol=5;break;
			case 6:	primitivepol=3;break;
			case 7:	primitivepol=9;break;
			case 8:	primitivepol=29;break;
		};
		gf[0]=1;inv_gf[0]=0;inv_gf[1]=0;inv_alfa[0]=0;inv_alfa[1]=1;
		for(int i=1;i<gfextend;i++){
			if(gf[i-1]<=maximo){gf[i]=gf[i-1]<<1;}
			else{gf[i]=gf[i-1]<<1;gf[i]=gf[i]^primitivepol;}
			gf[i]=gf[i]&gfextend;
			inv_gf[gf[i]]=i;
		}
		for(int i=1;i<gfextend;i++)
		{
			inv_alfa[gf[i]]=gf[gfextend-i];
		}
	}