Giter Club home page Giter Club logo

Comments (33)

songgeng87 avatar songgeng87 commented on July 17, 2024

多谢检查,我已发现问题所在,近日更新。

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

请给项目star

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

错误返回码已经更新,具体可查看sm9_algorithm.h

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

在代码中,签名主公钥被init函数作为系统参数做全局存储了。

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

应该是在 SM9_Set_Sign 函数内设置的。

类似的还有SM9_Set_Encrypt,SM9_Set_KeyExchange。

具体使用可以参考sm9_algorithm.h头文件

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

你这个主秘钥是公钥吧?
启动一下签名lib
SM9_Set_Sign(mspk.x1, mspk.x2, mspk.y1, mspk.x2, NULL);
就可以调用
SM9_Verify(msg, 20, &sign, &pk, NULL);
完成验签了

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

我更新了代码,修复了一个BUG。

关于验证,可以参考SM9Test.c中的”独立验证“部分。

单独运行该部分也是能够正确验证的。

顺序
SM9_Init(0,0,32,NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL );
gg = SM9_Set_Sign(mspk.x1, mspk.x2, mspk.y1, mspk.y2, NULL); // 启动签名lib
SM9_Verify(msg, 20, &sign, &pk, NULL);

我使用自己随机生成的签名能通过验证。但是你的数据无法正确通过验证。

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

原先的SM9Test.c 里面gg = SM9_Set_Sign(mspk.x1, mspk.x2, mspk.y1, mspk.2, NULL); 传入参数有误,应该分别传入mspk的 x1 x2 y1 y2 ,请仔细检查
请参考我最新的SM9Test.c
SM9_Set_Sign(NULL, NULL, NULL, NULL, gg)函数需要要求gg返回不是NULL才能继续执行。

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

songgeng87 avatar songgeng87 commented on July 17, 2024

有问题再继续交流~

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

sz777 avatar sz777 commented on July 17, 2024

from sm9_free.

Related Issues (19)

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.