Giter VIP home page Giter VIP logo

rsa's Issues

在vs2010 debug模式下报错

a=a>>(BigInt::basebitnum);

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.

有一处有点疑问

a=a>>(BigInt::basebitnum);//BigInt::basebitnum = 32
在copyFromLong里,这个语句好像没什么意义,不是把a设为0吗。不知道作者您的意图,希望指点一下。另外,通过学习你的代码学到了很多,谢谢。

BigInt有问题

0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffff 应为0xfffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffff0000000000000001。但是结果为0xFFFFFFDFFFFFFFC0FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFC1FFFFFFE100000001.

可见:0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffff / 0xffffffffffffffff != 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

程序崩溃

把代码加入到动态库中后,一加载动态库就失败,get错误 3765269347,应该是出在BigInt里面,但是没定位到问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.