I've written a few routines involving fast modular arithmetic (table lookup and bit-packing). It's very basic, but you should be able to extend it according to your needs. I'll mail it in the next e-mail (to Tushar Saxena, only). - Gene