【vc++精品源码栏目提醒】:网学会员为需要vc++精品源码的朋友们搜集整理了大整数乘法的实现与分析【毕业论文,绝对精品】 - 毕业设计相关资料,希望对各位网友有所帮助!
大整数乘法的实现与分析 摘 要 随着计算机信息安全要求的不断提高,密码学被大量应用到生活中。
RSA、ElGamal、DSA、ECC 等公钥密码算法和数字签名算法都建立在大整数运算的基础上,比较耗时的大整数乘法、除法、模乘、幂运算、幂乘等运算却被上述算法大量使用,它们的运算速度对这些算法的高效实现起着重要的作用,如何快速实现上述几种运算是公钥密码领域普遍关注的热点问题。
本文基于 32 位的系统,首先采用模块化的思想建立大整数运算库的基础框架,在实现一些辅助函数后在此框架上讨论并实现多精度大整数的基本加法、减法、乘法、除法、平方算法、缩减、模乘、模幂乘等算法。
所用程序均采用 C/C语言编写,所采用的优化也均建立在 C/C语言这一层面上,在保证算法有足够高的效率的同时力求代码清晰易懂,函数接口简单明了,具有可移植性和稳定性。
关键词:多精度大整数,Comba,Montgomery,二分查找,笔算注:本设计(论文)题目来源于企业项目。
I Abstract Nowadays as computer information security requirements improve continuously thecryptology has been widely applied to life. Public key cryptographic algorithms and digitalsignature algorithms such as RSA ElGamal DSA ECC are all base on multiple precisionarithmetic. Multiple precision multiplication Division modular multiplication exponen-tiation modular exponentiation which need more working time is used by public keycryptographic algorithms widely their speed is very important to the implementations of thosealgorithms. How to fast implement those arithmetic above is the hot topic in the public keycryptographic field. This paper is based on the 32 bit system. First of all we found the modular foundation ofmultiple precision arithmetic library After some auxiliary function is formed we discuss andimplement the multiple precision integer basic addition Subtractionmultiplication kinds of square algorithmsdivisionreduction and some relational function. All thealgorithm discuss in this paper is implement entirely in portable ISO C/Cand theoptimization of those algorithms implementations is built on the C/C language level. thealgorithm has high enough to ensure the efficiency of the code at the same time strive toclearly understand simple interface function with portability and stability. Key words: Multiple Precision IntegerCombaMontgomeryBinary search Written calculation II 目录1 绪论 ........................................................................................................................................1 1.1 题目的背景 ......................................................................................................................1 1.2 国内外研究状况 ..............................................................................................................1 1.3 本文研究内容 ..................................................................................................................22 大整数的结构 .........................................................................................................................3 2.1 大整数的存取结构 ..........................................................................................................3 2.1.1 大整数结构分析 .......................................................................................................3 2.1.2 大整数结构 ...............................................................................................................4 2.2 预定义的变量 ..................................................................................................................5 2.3 大整数基本函数定义 ......................................................................................................5 2.3.1 大整数初始化操作 ...................................................................................................5 2.3.2 大整数的销毁操作 ...................................................................................................6 2.3.3 大整数的扩展 ...........................................................................................................6 2.3.4 大整数的输入和输出函数 .......................................................................................6 2.4 大整数的移位函数 ..........................................................................................................7 2.4.1 字移位运算 ...............................................................................................................7 2.4.2 比特移位运算 ...........................................................................................................93 大整数加法和减法实现 .......................................................................................................13 3.1 符号相同的加法运算 ....................................................................................................13 3.2 符号不相同的加法运算 ................................................................................................164 大整数乘法实现 ...................................................................................................................19 4.1 笔算乘法........................................................................................................................19 4.2 使用 COMBA 方法的快速乘法 ......................................................................................22 4.3 平方算法 ........................................................................................................................24 4.3.1 笔算平方算法 .........................................................................................................25 4.3.2 Comba 思想的平方算法.........................................................................................27 III5 大整数模缩减实现 ...............................................................................................................30 5.1 模 2 的幂 ...................
上一篇:
企业日常工作排班系统【毕业论文,绝对精品】
下一篇:
问卷调查可以自动生成试卷等,并且只能一个用户登录