mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-11 03:26:17 +08:00
Updated Armv8.2 SM3和SM4 (markdown)
parent
814bd2002c
commit
fd0ff5388c
@ -131,7 +131,7 @@ Vd[3] = P1(C XOR (R1 <<< 15)), 这里 C 是另外两个字的异或结果, R1
|
||||
SM3PARTW2中的tmp.value[0]就是R2
|
||||
P1(C XOR (R1 <<< 15)) XOR P1(R2 <<< 15) = P1(C XOR (R1 <<< 15) XOR (R2 <<< 15)) = P1(C XOR ((R1 XOR R2) <<< 15))
|
||||
```
|
||||
所以,关键就是**循环位移对异或运算满足分配律成立**。
|
||||
所以,关键就是**循环位移对异或运算满足分配律成立**, 或者更一般的,**逻辑位移运算对异或运算满足分配律**, [Does a shift operation distribute over XOR](https://cs.stackexchange.com/questions/58264/does-a-shift-operation-distribute-over-xor/58266)。
|
||||
|
||||
[模拟代码](https://gist.github.com/emmansun/c05b5e2262997ae546950f806fcd0146)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user