]> granicus.if.org Git - python/commit
Issue #19171: speed some cases of 3-argument long pow().
authorTim Peters <tim@python.org>
Sat, 5 Oct 2013 21:53:52 +0000 (16:53 -0500)
committerTim Peters <tim@python.org>
Sat, 5 Oct 2013 21:53:52 +0000 (16:53 -0500)
commit61e9ffa191aa3a3270c5efcd3f1d05810419b63f
tree30c477d286fdec32bc771e050a4d1c760322023a
parent8f89928b5a0b21a628977dd14f0e8724806d9083
Issue #19171:  speed some cases of 3-argument long pow().

Reduce the base by the modulus when the base is larger than
the modulus.  This can unboundedly speed the "startup costs"
of doing modular exponentiation, particularly in cases where
the base is much larger than the modulus.  Original patch
by Armin Rigo, inspired by https://github.com/pyca/ed25519.
(grafted from f34c59494420765b013136ca93f63b716d9f1d30)
Objects/longobject.c