模逆算法的分析、改进及测试
Analysis and Improvement of Modular Inverse Algorithm
-
摘要: 公钥密码实现中,模逆算法经常是算法实现的瓶颈。通常求模逆的运算方法牵涉到大量的除法和减法操作,而除法操作需要大量的运算开销。基于现有的求最大公因子的方法,分析利用扩展欧几里德求模逆的方法,以及二进制扩展欧几里德算法,提出了利用二进制扩展欧几里德算法求模逆的方法,给出了几种算法性能比较的测试环境和测试结果。测试结果表明:改进的算法比利用扩展欧几里德求模逆的方法速度更快,对硬件实现更具有普遍性。Abstract: Usually modular inverse operation becomes bottlenecked in realizing the public key cryptosystem. The method commonly used leads to a lot of division operation. The modular inverse operation by extended Euclidean algorithm and the binary extended Euclidean algorithm are analyzed, and the improved modular inverse operation by binary extended Euclidean algorithm is presented in this paper. The result shows that the new algorithm runs faster than the old one under the given testing environment. Furthermore it has much more feasibility in hardware realization.