Commit a0fe4ae
committed
cheri: Use conditional copy over bitmask arithmetic in sakke_modexp_loop
On CHERI casting mp_int pointers to wc_ptr_t for the bitmask
arithmetic strips the hardware capability tag. The reconstructed
pointer won't have a valid tag and will cause a tag violation when it
is dereferenced.
Under __CHERI_PURE_CAPABILITY__, replace the pointer arithmetic with
four mp_cond_copy calls that operate on the digit data directly.
This preserves the capability tags and accesses both accumulators
unconditionally.
Non-CHERI builds retain the original wc_off_on_addr path unchanged.
Signed-off-by: William Beasley (The Capable Hub) <wbeasley@thegoodpenguin.co.uk>1 parent aee7f40 commit a0fe4ae
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2649 | 2649 | | |
2650 | 2650 | | |
2651 | 2651 | | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
2652 | 2658 | | |
2653 | 2659 | | |
2654 | 2660 | | |
2655 | 2661 | | |
2656 | 2662 | | |
2657 | 2663 | | |
| 2664 | + | |
2658 | 2665 | | |
2659 | 2666 | | |
2660 | 2667 | | |
| |||
0 commit comments