Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过签名恢复公钥 #25

Open
czdsdo opened this issue Nov 17, 2020 · 0 comments
Open

通过签名恢复公钥 #25

czdsdo opened this issue Nov 17, 2020 · 0 comments

Comments

@czdsdo
Copy link

czdsdo commented Nov 17, 2020

dA为私钥,PA为公钥,PA=dAG
s = (1+dA)^-1*(k - r *dA ) mod n
s *(1+dA) =(k - r *dA )
两边乘以G,
s (1+dA) G = sG + sdAG = sG + sPA = kG - r *dA G = kG - rPA

PA =(s+r)^-1 * (kG - sG)
k为未知数,令曲线上点R=kG,签名结果中的r就是R的x坐标
PA= (s+r)^-1 * (R - sG)
已知R的x坐标,需求对应R的y坐标。
由于对称性,y会有两个,一个奇数一个偶数。
还需要用一标识表明公钥奇偶性来恢复公钥。

测试功能,请勿在生产环境下使用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant