# Complexity of $\gcd$ algorithm

I'm reading a paper in which it's used the fact that a gcd computation of two numbers $(a,n)$, can be done in $O(\log n)$ time, and $[1]$ is referenced for the result. I haven't found that specific method. I've read through modifications of the extended euclidean algorithm, and modular algorithms, but all of them have linear complexities, not logarithmic. Could anybody point me to an algorithm that can do it in logarithmic time? Also, I don't actually need to calculate the gcd, just to test whether $$1<(a,n)<n$$

$[1]$ von zur Gathen, Gerhard. Modern computer algebra

• See this question and answer. – Brian M. Scott Apr 5 '15 at 18:38
• @BrianM.Scott Thank you very much. – MyUserIsThis Apr 5 '15 at 19:04
• You’re very welcome. – Brian M. Scott Apr 5 '15 at 19:06