Code Monkey home page Code Monkey logo

Comments (13)

songjinlian avatar songjinlian commented on May 19, 2024

参考工具
图片

sm2tool.zip

from toolsfx.

Leon406 avatar Leon406 commented on May 19, 2024

bouncy castle是个偏向业务,理论学习的需要开发人员有相关的理论基础

能提供椭圆曲线运算相关算法及理论支持吗,或者相关代码

from toolsfx.

Leon406 avatar Leon406 commented on May 19, 2024

看了下bouncy castle 库有现成的点加,点乘运算,曲线参数,提供下测试数据,我研究看下

from toolsfx.

songjinlian avatar songjinlian commented on May 19, 2024

bouncy castle是个偏向业务,理论学习的需要开发人员有相关的理论基础

能提供椭圆曲线运算相关算法及理论支持吗,或者相关代码
SM2算法源代码.zip

from toolsfx.

songjinlian avatar songjinlian commented on May 19, 2024

看了下bouncy castle 库有现成的点加,点乘运算,曲线参数,提供下测试数据,我研究看下
GBT 32918.5-2017 信息安全技术 SM2椭圆曲线公钥密码算法 第5部分:参数定义.zip

附录C有实例

from toolsfx.

songjinlian avatar songjinlian commented on May 19, 2024

看了下bouncy castle 库有现成的点加,点乘运算,曲线参数,提供下测试数据,我研究看下
输入:
x1:09F9DF311E5421A150DD7D161E4BC5C672179FAD1833FC076BB08FF356F35020
y1:CCEA490CE26775A52DC6EA718CC1AA600AED05FBF35E084A6632F6072DA9AD13
k:59276E27D506861A16680F3AD9C02DCCEF3CC1FA3CDBE4CE6D54B80DEAC1BC21
输出:
x:335E18D751E51F040E27D468138B7AB1DC86AD7F981D7D416222FD6AB3ED230D
y:AB743EBCFB22D64F7B6AB791F70658F25B48FA93E54064FDBFBED3F0BD847AC9
图片

from toolsfx.

Leon406 avatar Leon406 commented on May 19, 2024

SM2已经可以了
还有没有其他椭圆曲线测试参数

curve25519
secp112r1
secp112r2
secp128r1
secp128r2
secp160k1
secp160r1
secp160r2
secp192k1
secp192r1
secp224k1
secp224r1
secp256k1
secp256r1
secp384r1
secp521r1
sect113r1
sect113r2
sect131r1
sect131r2
sect163k1
sect163r1
sect163r2
sect193r1
sect193r2
sect233k1
sect233r1
sect239k1
sect283k1
sect283r1
sect409k1
sect409r1
sect571k1
sect571r1
sm2p256v1 (SM2)

from toolsfx.

Leon406 avatar Leon406 commented on May 19, 2024

https://leon.lanzoub.com/b0d9av2kb 提取码:52pj 网盘已经上传 测试的jar包, 大数模块里有ECC功能

from toolsfx.

songjinlian avatar songjinlian commented on May 19, 2024

https://leon.lanzoub.com/b0d9av2kb 提取码:52pj 网盘已经上传 测试的jar包, 大数模块里有ECC功能
KDF计算
t=KDF(x2 || y2 ,klen),klen为明文的长度
输入:
坐标x2:335E18D751E51F040E27D468138B7AB1DC86AD7F981D7D416222FD6AB3ED230D
坐标y2:AB743EBCFB22D64F7B6AB791F70658F25B48FA93E54064FDBFBED3F0BD847AC9
输出:44E60FDBF0BAE81437665374BEF26749046C9E

图片

from toolsfx.

songjinlian avatar songjinlian commented on May 19, 2024

secp112r1

其他椭圆曲线测试参数未收集到经多方验证的参数,等收集到反馈给您

from toolsfx.

Leon406 avatar Leon406 commented on May 19, 2024

https://www.lanzoub.com/b0d9av2kb 提取码:52pj 网盘已经上传 测试的jar包, 大数模块里有ECC功能
KDF计算
t=KDF(x2 || y2 ,klen),klen为明文的长度
输入:
坐标x2:335E18D751E51F040E27D468138B7AB1DC86AD7F981D7D416222FD6AB3ED230D
坐标y2:AB743EBCFB22D64F7B6AB791F70658F25B48FA93E54064FDBFBED3F0BD847AC9
输出:44E60FDBF0BAE81437665374BEF26749046C9E

图片

这个不知道怎么算,暂时就不加了

from toolsfx.

songjinlian avatar songjinlian commented on May 19, 2024

https://www.lanzoub.com/b0d9av2kb 提取码:52pj 网盘已经上传 测试的jar包, 大数模块里有ECC功能
KDF计算
t=KDF(x2 || y2 ,klen),klen为明文的长度
输入:
坐标x2:335E18D751E51F040E27D468138B7AB1DC86AD7F981D7D416222FD6AB3ED230D
坐标y2:AB743EBCFB22D64F7B6AB791F70658F25B48FA93E54064FDBFBED3F0BD847AC9
输出:44E60FDBF0BAE81437665374BEF26749046C9E

图片

这个不知道怎么算,暂时就不加了
计算原理如下:
图片

当长度小于256比特时,相关于sm3的输出结果。大于256比特时,多次SM3计算,只是要将ct++
图片

from toolsfx.

Leon406 avatar Leon406 commented on May 19, 2024

KDF函数有很多,都不一样,都需要加盐的,这里SM2的kdf是SM3简单hash截取的

建议使用哈希模块计算,再取指定输出长度

from toolsfx.

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.