Computing A*B (mod N) efficiently in ANSI C

Henry G. Baker
1992 SIGPLAN notices  
The modular product computation A*B (mod N) is a bottleneck for some public-key encryption algorithms, as well as many exact computations implemented using the Chinese Remainder Theorem. We show how to compute A*B (mod N) efficiently, for single-precision A,B, and N, on a modern RISC architecture (Intel 80860) in ANSI C. On this architecture, our method computes A*B (mod N) faster than ANSI C computes A%N, for unsigned longs A and N.
doi:10.1145/130722.130735 fatcat:5rmmpzh3g5fzjlbt36i6rug5ou