At least on pypy, divmod actually saves instructions (both div and mod are
implemented in terms of divmod), I assume this is true on CPython as well


On Fri, Oct 4, 2013 at 9:56 PM, Christopher Swenson <
notifications@github.com> wrote:

> In ed25519.py:
>
> > +       are both quadratic, so this is likely the fastest way to do this.
> > +
> > +       See, for example, H. Cohen, A Course in Computational Algebraic Number
> > +       Theory, Algorithm 1.3.6
> > +    """
> > +    a, b = z, q
> > +    if b == 0:
> > +        return 1
> > +    u = 1
> > +    d = a
> > +    r = 0
> > +    div = b
> > +    while True:
> > +        if div == 0:
> > +          return u
> > +        qq, div, d = d // div, d % div, div
>
> Ah, I forgot about divmod. I'll double check, but you're probably right.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/ed25519/pull/7/files#r6782936>
> .
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084