mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 01:30:49 +02:00
7cba06da8a
The branchless code in casts sp_int pointers to size_t for bitmask arithmetic, then casts the result back to sp_int*. On CHERI, pointer-to-integer casts strip the hardware capability tag. The reconstructed pointer is tagless and cannot be dereferenced, causing a tag-violation fault. Add _sp_cond_copy that uses the bitmask on the digit data itself rather than the addresses, this avoids needed to do pointer arithmetic. On non-CHERI targets the behaviour is the same. Signed-off-by: William Beasley (The Capable Hub) <wbeasley@thegoodpenguin.co.uk>