文档库 最新最全的文档下载
当前位置:文档库 › 基于kary消减的快速最大公约数算法

基于kary消减的快速最大公约数算法

龙源期刊网 https://www.wendangku.net/doc/389914749.html,

基于kary消减的快速最大公约数算法

作者:王广赛曾光韩文报李永光

来源:《计算机应用》2015年第06期

摘要:最大公约数(GCD)算法中是计算数论的基础课题之一,它在密码算法和密码分析中有着非常广泛的应用,对于输入B和C,利用Sorenson的右移kary消减(rightshift kary reduction)思想提出一个算法用于寻找整数x和y,使得x和y满足Bx-Cy在二进制表示下低比特位部分为0,即Bx-Cy=0(mod 2e),其中e是常数正整数。利用该算法能够右移较多比特并大规模降低循环次数。再结合模算法,提出了快速GCD算法,其输入规模为n比特时最差复杂度仍然是O(n2),但最好的情况下复杂度能达到O(运算顺序是否要加括号由于该方向的表述都是这样,所以这样描述是合理的。O(nlog2nloglogn)

就是O(n*log^2(n)*log(log(n)))。n log2 n log log n)。实验数据表明,对于20万以上比特规模的输入,快速GCD算法比Binary GCD算法速度快;对100万比特规模的输入,快速GCD算法速度是Binary GCD算法的两倍。

关键词:最大公约数算法;欧几里得算法;二进制最大公约数算法;右移kary消减;整

数最大公约数算法

中图分类号: TP309 文献标志码:A

英文摘要

Abstract: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 rightshift kary reduction proposed by Sorenson was presented for finding the integers x and y which satisfy the least significant bits of Bx-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(n2). In the best case, the complexity of the proposed algorithm could achieve O(n log2 n log log n). The experimental data show that actual implementations given input about more than 200000 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.

英文关键词

相关文档
相关文档 最新文档