Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[otbn/rsa] Add SCA hardening for sel_sqr_or_sqrmul
This commit hardens two sources of leakage - DMEM writeback: The selected temporary result, either sqr or sqrmul depending on the current exponent bit, is written to the DMEM. At this DMEM address the sqr result is stored. In the case of selecting the sqr result the HD of the selected result and the DMEM value is zero and in the other case a high value. This allows to distinguish exponent bits. The hardening overwrites the value at the DMEM address with a random value. - SEL instruction: BN.SEL selects one of the two source WDRs based on the carry flag. The selection depends on the current exponent bit. This allows to distinguish exponent bits. The hardening randomizes the WDRs which contain the sqr or sqrmul results. The randomization is performed for each limb. Signed-off-by: Johann Heyszl <[email protected]> Signed-off-by: Alexander Wagner <[email protected]>
- Loading branch information