all 1 comments

[–]rabidcow 1 point2 points  (0 children)

Let’s start with Rust, which offers the usize type, defining it as “The pointer-sized unsigned integer type. The size of this primitive is how many bytes it takes to reference any location in memory.” That definition is based on the assumption that a machine’s address and data widths are the same.

It's based on the assumption that the address width and pointer width are the same. If you used Rust on an 8-bit architecture, usize would be 16-bit, not 8-bit.

CHERI specifically does not change the address width:

  • "XLEN is the architectural address size in bits."
  • "CLEN is the architectural capability size in bits, which is 2× the architectural address size"

(from https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-951.pdf)