[Nickle]polytime primes and polynomials
Bart Massey
nickle@nickle.org
Fri, 16 Aug 2002 23:36:41 -0700
For your amusement and edification. I've implemented and
checked into the Nickle distribution examples directory the
newly-announced polytime primality test due to Agrawal,
Kayal, and Saxena. It may be polytime, but boy is it slow:
n^6 is nothing to sneeze at. OTOH, it only took about 6-8
hours of coding including fixing Nickle bugs and misfeatures
and implementing infrastructure: I wouldn't even want to try
it in any other language I'm aware of. is-prime.5c runs the
primality test for successive integers (with brute force for
integers smaller than some bound, currently 50), and checks
it against the Miller-Rabin BPP test I implemented long ago.
In the process of implementing this, I needed to do
arithmetic on fields mod integer-coefficient polynomials, so
I implemented integer-coefficient polynomials as well. (The
implementation could be easily altered to have rational or
modular coefficients, but there are deep language waters
here: language design suggestions around parameterizing this
would be received with interest.) polynomial.5c has the
functionality.
Have fun!
Bart