diff --git a/SM3中的FF2和GG2函数.md b/SM3中的FF2和GG2函数.md index dab8512..68e3fb5 100644 --- a/SM3中的FF2和GG2函数.md +++ b/SM3中的FF2和GG2函数.md @@ -4,8 +4,9 @@ $GG2(X, Y, Z) = (X \land Y) \lor (\lnot X \land Z)$ # 等价公式 $FF2(X, Y, Z) = (X \land Y) \bigoplus (X \land Z) \bigoplus (Y \land Z)$ -$GG2(X, Y, Z) = (Y \bigoplus Z) \land X \bigoplus Z$ - +$GG2(X, Y, Z) = (Y \bigoplus Z) \land X \bigoplus Z$ + +GG2等价公式初次见于[Intel® Integrated Performance Primitives Cryptography](https://github.com/intel/ipp-crypto) # 应用 特别是GG2,其等价公式相比原来的公式,因其简单,具有一点点性能优势(不明显),也可以省一个寄存器,还有就是ANDN指令属于[BMI1](https://en.wikipedia.org/wiki/X86_Bit_manipulation_instruction_set#BMI1_(Bit_Manipulation_Instruction_Set_1)),有些老机器不支持。