Available on RISC-V RV32 only.
Expand description
P0
transformation function as is used in the SM3 hash algorithm
This function is included in Zksh
extension. It’s defined as:
P0(X) = X ⊕ (X ≪ 9) ⊕ (X ≪ 17)
where ⊕
represents 32-bit xor, and ≪ k
represents rotate left by k
bits.
In the SM3 algorithm, the P0
transformation is used as E ← P0(TT2)
when the
compression function CF
uses the intermediate value TT2
to calculate
the variable E
in one iteration for subsequent processes.
According to RISC-V Cryptography Extensions, Volume I, the execution latency of this instruction must always be independent from the data it operates on.