摘要
最大公约数(GCD)算法中,对于输入B和C,利用Sorenson的右移k-ary消减思想提出一个算法用于寻找整数x和y,使得x和y满足Bx-Cy在二进制表示下低比特位部分为0,即Bx-Cy=0(mod 2e),其中e是常数正整数。利用该算法能够右移较多比特并大规模降低循环次数。再结合模算法,提出了快速GCD算法,其输入规模为n比特时最差复杂度仍然是O(n2),但最好的情况下复杂度能达到O(n log2n log log n)。实验数据表明,对于20万以上比特规模的输入,快速GCD算法比Binary GCD算法速度快;对100万比特规模的输入,快速GCD算法速度是Binary GCD算法的两倍。
Greatest Common Divisor (GCD) is one of the basic subjects in computational number theory. It has a wide application in encryption and analysis of cryptography. For inputing B and C, an algorithm based on right-shift k-ary reduction proposed by Sorenson was presented for finding the integers x and y which satisfy the least significant bits ofBx - Cy were 0, i. e., Bx - Cy = 0( mod 2e ) where positive integer e was a constant. It could do a lot of right shifts and reduce a large number of cycles with taking advantage of the algorithm for finding the integers x and y. A fast GCD algorithm was proposed combined with modulus algorithm. When the size of the input was n bits, the worst complexity of the fast GCD algorithm was still O( n^2) . In the best case, the complexity of the proposed algorithm could achieve O ( n log^2 n log log n ). The experimental data show that actual implementations given input about more than 200 000 bits, the fast GCD algorithm is faster than the Binary GCD algorithm, and the fast GCD algorithm is twice as fast as the Binary GCD algorithm for 1 million bits of input.
出处
《计算机应用》
CSCD
北大核心
2015年第6期1673-1677,1697,共6页
journal of Computer Applications
基金
国家自然科学基金资助项目(61003291)
数学工程与先进计算国家重点实验室开放课题基金资助项目(2013A03
2013A10)
关键词
最大公约数算法
欧几里得算法
二进制最大公约数算法
右移k-ary消减
整数最大公约数算法
Greatest Common Divisor (GCD) algorithm
Euclidean algorithm
binary Greatest Common Divisor (GCD) algorithm
right-shift k-ary reduction
integer greatest common divisor algorithm