Coder Social home page Coder Social logo

关于sm9曲线参数设置 about cryptogm HOT 24 CLOSED

xlcetc avatar xlcetc commented on June 12, 2024
关于sm9曲线参数设置

from cryptogm.

Comments (24)

triplewz avatar triplewz commented on June 12, 2024 1

上面的G2生成元也是sm9G2生成元的蒙哥马利表示方法

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024 1

这个值是要选择一个Fp2里面的非平方根和非立方根,sm9确实没有给具体值,但是-1/2i是满足的

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024 1

image pminusone是指p-1吗?为什么值与p-2相差那么大

pMinus1应该是蒙哥马利表示方法

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024 1

不好意思哈,再打扰一下。
image
用genconsts.go生成的结果跟您在constant.go里定义的数值不同是怎么回事?以哪个为准

以constant.go中的值为准,genconsts.go打印xi的值的时候改变了原来的值,已经修改。

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

参数主要用于优化BN256曲线计算的,生成方式可以参考genconst里面的代码,具体原理可以参考使用的地方,有一些写在注释里了,有一些也标出了论文出处,可以参考

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

参数主要用于优化BN256曲线计算的,生成方式可以参考genconst里面的代码,具体原理可以参考使用的地方,有一些写在注释里了,有一些也标出了论文出处,可以参考
谢谢。
请问这个b的值是怎么来的?
image

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

image
还有这里,上述值跟sm9文档中的G2是有什么关系?
image
麻烦您再解答一下,谢谢,辛苦了

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

参数主要用于优化BN256曲线计算的,生成方式可以参考genconst里面的代码,具体原理可以参考使用的地方,有一些写在注释里了,有一些也标出了论文出处,可以参考
谢谢。
请问这个b的值是怎么来的?
image
b是-1/2的蒙哥马利表示方法,是sm9扩域的参数吧
image

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

image
啊我没有表达清楚,我主要是想知道这串参数是从哪个文档获得的?我在国密9的标准文档中好像没有看到。
顺便祝您端午安康~

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

这个值是要选择一个Fp2里面的非平方根和非立方根,sm9确实没有给具体值,但是-1/2i是满足的

这个值是出自哪个文献?

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

sm9里面的描述:
image
bn256论文的描述:
image

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

好的谢谢
再问一下,这个变量的数据是怎么得来的?
image

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

image
pminusone是指p-1吗?为什么值与p-2相差那么大

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

好的谢谢 再问一下,这个变量的数据是怎么得来的? image

根据G1和G2生成元计算一次pairing就可以了

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

好的谢谢!!

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

不好意思哈,再打扰一下。
image
用genconsts.go生成的结果跟您在constant.go里定义的数值不同是怎么回事?以哪个为准

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

image
s的定义中sqrt(-3),怎么用程序实现。依然使用math/big包吗

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

image s的定义中sqrt(-3),怎么用程序实现。依然使用math/big包吗

我运行了您在bn256_test中写的genS的过程,但结果没有跟constant.go中s 的值对上。所以希望您详细的讲解一下sqrt(-3),怎么用程序实现

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

参考sm9c1.4里面的有限域求平方根:
image
bn256_test s应该是把ss从蒙哥马利表示方法decode一下,里面有些值测试临时使用的,ss值:
9daaaaaaae2f89472af8f15476909b18298c464234e93cfdc94cedfd9c1b1fc
表示成gfp形式:
gfP{0xdc94cedfd9c1b1fc, 0x8298c464234e93cf, 0x72af8f15476909b1, 0x9daaaaaaae2f8942

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

好的谢谢。
请问您知道hid 也就是签名函数中提到的签名私钥生成函数识别符是什么吗?为什么设置为0x01呢

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

这个其实没有确定值,sm9里给的说明是用一个字节表示的私钥生成函数识别符,由 KGC 选择并公开
但是sm9给的例子里,签名算法用的是1,密钥交换用的是2,密钥封装和公钥加密用的是3,所以测试用例里参考例子的值。

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

所以是不是hid的取值可以是任意数值,只要可以用一个字节表示。

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

按定义确实是这样

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

好的谢谢!

from cryptogm.

Related Issues (5)

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.