shaojunhan / rsa Goto Github PK
View Code? Open in Web Editor NEWC++ code of 1024 rsa
C++ code of 1024 rsa
如题
Line 56 in 61a3eb7
if (n == BigInt::One) return false;
也许可以使用更优秀的质数生成算法,而不是while嵌套
如题
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffff 应为0xfffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffff0000000000000001。但是结果为0xFFFFFFDFFFFFFFC0FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFE100000001.
可见:0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffff / 0xffffffffffffffff != 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
用debug编译后程序不能正常运行,无法进入main函数
个人认为由于未使用快速模幂算法。
Line 175 in 61a3eb7
1右移32位在vs2010 debug模式下还是1. 32位整型右移32位是未定义行为,会引起bug
C99中,对右移有这样的规定:
If the value of the right operand is negative or is
greater than or equal to the width of the promoted left operand, the behavior is undefined.
把代码加入到动态库中后,一加载动态库就失败,get错误 3765269347,应该是出在BigInt里面,但是没定位到问题
a=a>>(BigInt::basebitnum);//BigInt::basebitnum = 32
在copyFromLong里,这个语句好像没什么意义,不是把a设为0吗。不知道作者您的意图,希望指点一下。另外,通过学习你的代码学到了很多,谢谢。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.