Giter VIP home page Giter VIP logo

Comments (4)

lpilp avatar lpilp commented on August 14, 2024 1

这个没有问题,这个函数其实就是做一个 dechex() 函数,10进制转16进制而已,项目最初是从别人的项目进行更新修改的,一些转换什么函数没有去变动,这个理论上就得加intval的,最后的chr( int assic ),需要传int值,传float值的话就取整数部分了,中间的运算也都是整数运算,不会有什么问题,你是遇到什么问题了不,我看看。
感谢关注!
PS: 正在弄不依赖其他库的版本,应该会支持 >=5.4 或是5.6 一个简化的签名验签版本,有需要请关注,大概会在6月中上

from phpsm2sm3sm4.

lpilp avatar lpilp commented on August 14, 2024 1

看了下,的确是欠考虑了,原来的加解密缺省返回的hex, 本想支持下 base64,逻辑上有点问题,感谢反馈,一会更新

from phpsm2sm3sm4.

lpilp avatar lpilp commented on August 14, 2024 1

这个1.0.7缺省返回的base64了,已回退了,发了1.0.8

from phpsm2sm3sm4.

yxqa123 avatar yxqa123 commented on August 14, 2024

我的项目使用的 1.0.4.1 1.0.6 1.0.7 。 1.0.6以前版本调用1.0.7会出现如下错误
Mdanter\\Ecc\\Exception\\PointNotOnCurveException: Curve curve(115792089210356248756420345214020892766250353991924191454421193933289684991996, 18505919022281880113072981827955639221458448578012075254857346196103069175443, 115792089210356248756420345214020892766250353991924191454421193933289684991999) does not contain point (45772322330626260826179297330184340691829805985099039874230889719991419483448, 25052822987909541241313578494655523568405754683422640265628383083751450685796) in \vendor\\mdanter\\ecc\\src\\Primitives\\Point.php:102\nStack trace:\n#0 \vendor\\lpilp\\guomi\\src\\sm\\RtSm2.php(178): Mdanter\\Ecc\\Primitives\\Point->__construct(Object(Mdanter\\Ecc\\Math\\GmpMath), Object(Mdanter\\Ecc\\Curves\\NamedCurveFp), Object(GMP), Object(GMP))\n#1 Rtgm\\sm\\RtSm2->doDecrypt('653237633337383...', '5DD701828C424B8...')\n#2
当统一使用 1.06及以前一切正常,统一使用1.07 也一切正常。
diff 1.07及 1.06 发现只有此处可能影响sm2加解密结果

` 这一块儿 新版本做了相应更改但加解密也是对不上~

  if($this->formatSign=='base64'){
        $encryptData = bin2hex(base64_decode($encryptData));
    }

`

from phpsm2sm3sm4.

Related Issues (20)

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.