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

使用32*256的缓存提升SM2基点倍乘性能 #1558

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zhujunling-nj
Copy link
Contributor

使用32*256的缓存提升SM2基点倍乘性能,将基点倍乘转换成32次点加运算,可显著提升SM2签名速度

@wendal
Copy link
Contributor

wendal commented Sep 21, 2023

借问一下, 能提升多少呢?

@wendal
Copy link
Contributor

wendal commented Sep 21, 2023

这个修改需要的栈内存还不小

@zzl360
Copy link

zzl360 commented Oct 8, 2023

这个修改需要的栈内存还不小

静态变量存储在堆里而不是栈里

@zhujunling-nj
Copy link
Contributor Author

zhujunling-nj commented Oct 8, 2023

原来签名时椭圆曲线运算量:约256次双倍运算+128次加法算法,现在只需32次加法运算,椭圆曲线运算提升12倍,整体签名性能提升约7-8倍

借问一下, 能提升多少呢?

@zhujunling-nj
Copy link
Contributor Author

这个修改需要的栈内存还不小

静态变量存储在DSS段(未初始化时)或DATA段(已初始化时),不在栈里。

@wendal
Copy link
Contributor

wendal commented Oct 27, 2023

sizeof(SM2_JACOBIAN_POINT) == 3*8

3* 8 * 32 * 256 = 192k字节

好吧, 看来我嵌入式场景用不上这个修改

速度提高这么多, 真的很厉害

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

Successfully merging this pull request may close these issues.

3 participants