Now that work on [feature-requests:#1006] has started, we should also look into the stm8-specific aspects. We then need fixes or documentation. A first view shows:
- Side channels are created in trunk in codegen for addition, subtraction, the division hardware bug woraround, for right shifts (data from left operand leaked). These will be fixed in the nosidechannel branch today.
- There are side-channels in codegen for division / modulo, shifts (right operand), comparisons, shifts (data from right operand leaked), rotations, signed casts. reads from signed bit-fields.
- There are side channels in support routines.
- Peephole optimizer rules do not introduce side-channels.
Diff:
Related
Feature Requests: #1006
Diff:
Diff:
Diff:
Related
Feature Requests: #1006
By now, the low-hanging fruit has been dealt with in the nosidechannels branch. Some cases were easy to fix, some turned out to not exist after all (a conditional branch followed by a single-cycle instruction followed by the target label - looks like a timing side-channel at first sight due tot he conditional jump, but on closer analysis the conditional jump takes 2 cycles when branching, 1 when not, so the total execution time of this construct is always two cycles).
Remaining: