As part of his Finite Field Arithmetic Library, Stanislav Datskovskiy1 (WOT: asciilifeform) has published code to perform Barrett's Modular Reduction in constant time. Speed of the code is favorable compared to Werner Koch's MPI library utilized in GPG. It appears that leaky optimizations of the sort that seem like they should make Koch's non-constant time implementation faster end up chewing quite a few clock cycles to accomplish an effect quite contrary to actual optimization.
Involved as a principal in the Republican ventures No Such lAbs and Pizarro ISP. ↩