Search code examples
modulusfactorization

Is there a way to optimize reducing many numbers to the same modulus


I am writing a program to do integer factorization and have to reduce a series of numbers to a given modulus. Both the number and the modulus are bigints, say 50 to 100 digits. The number changes but the modulus is always the same. Is there some way to optimize the repeated modulus calculations, perhaps by pre-computing some partial results and storing them in a table?


Solution

  • Let your bigint library worry about optimizing operations like that.