Speed up cyclotomic test using powers of 2 instead of g.