mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-19 23:46:18 +08:00
Updated SM2 MFMM (2) (markdown)
parent
eed9045293
commit
75d0ce1057
@ -55,6 +55,30 @@ $t_3=t_3 + t_0 \ast p_3$
|
||||
乘法: 3
|
||||
加法:10
|
||||
|
||||
使用MULXQ/ADCXQ/ADOXQ:
|
||||
```asm
|
||||
MOVQ t0, DX
|
||||
XORQ BX, BX
|
||||
XORQ SI, SI
|
||||
|
||||
MULXQ p1, AX, DI
|
||||
ADCXQ BX, AX
|
||||
ADOXQ AX, t1
|
||||
|
||||
MULXQ p2, AX, BX
|
||||
ADCXQ DI, AX
|
||||
ADOXQ AX, t2
|
||||
|
||||
MULXQ p3, AX, t0
|
||||
ADCXQ BX, AX
|
||||
ADOXQ AX, t3
|
||||
|
||||
ADCXQ SI, t0
|
||||
ADOXQ SI, t0
|
||||
```
|
||||
乘法: 3
|
||||
加法:8
|
||||
|
||||
### 方案二:(移位、加法、减法)
|
||||
$T_2=T_1 \ast P=t_0 \ast P= t_0 \ast (2^{256}-(2^{32} \ast 2^{192} + 0 \ast 2^{128} + (2^{32} - 1) \ast 2^{64} + 1))$
|
||||
$T_2=t_0 \ast 2^{256} - t_0 \ast 2^{32} \ast 2^{192} - t_0 \ast (2^{32} - 1) \ast 2^{64} - t_0$
|
||||
|
Loading…
x
Reference in New Issue
Block a user