Skip to main content

WitnessRecord

Struct WitnessRecord 

Source
pub struct WitnessRecord {
    pub sequence: u64,
    pub timestamp_ns: u64,
    pub action_kind: u8,
    pub proof_tier: u8,
    pub flags: u8,
    pub actor_partition_id: u32,
    pub target_object_id: u64,
    pub capability_hash: u32,
    pub payload: [u8; 8],
    pub prev_hash: u32,
    pub record_hash: u32,
    pub aux: [u8; 8],
    /* private fields */
}
Expand description

A single witness record. Exactly 64 bytes, cache-line aligned.

All fields are little-endian. The record is #[repr(C, align(64))] to guarantee layout and alignment on all target architectures (AArch64, RISC-V, x86-64).

§Layout

OffsetSizeFieldDescription
08sequenceMonotonic sequence number
88timestamp_nsNanosecond timestamp
161action_kindPrivileged action discriminant
171proof_tierProof tier (1, 2, or 3)
181flagsAction-specific flags
191_reservedReserved (must be zero)
204actor_partition_idActor partition
248target_object_idTarget object
324capability_hashTruncated cap hash
368payloadAction-specific data
444prev_hashFNV-1a chain link
484record_hashFNV-1a self-integrity
528auxSecondary payload / TEE sig
604_padPadding to 64 bytes

Fields§

§sequence: u64

Monotonic sequence number. Provides global ordering of all privileged actions.

§timestamp_ns: u64

Nanosecond timestamp from the system timer (CNTVCT_EL0 / rdtsc).

§action_kind: u8

Which privileged action was performed (see ActionKind).

§proof_tier: u8

Which proof tier authorized this action (1 = P1, 2 = P2, 3 = P3).

§flags: u8

Action-specific flags (interpretation varies by action_kind).

§actor_partition_id: u32

Partition that performed the action.

§target_object_id: u64

Object acted upon: partition, region, capability, etc.

§capability_hash: u32

Truncated FNV-1a hash of the capability used (not the full token).

§payload: [u8; 8]

Action-specific data, packed by kind.

Examples:

  • PartitionSplit: new_id_a in bytes [0..4], new_id_b in bytes [4..8].
  • RegionTransfer: from_partition in bytes [0..4], to_partition in bytes [4..8].
§prev_hash: u32

FNV-1a hash of the previous record (chain link for tamper evidence).

§record_hash: u32

FNV-1a hash of bytes [0..44] of this record (self-integrity).

§aux: [u8; 8]

Secondary payload or TEE signature fragment.

Implementations§

Source§

impl WitnessRecord

Source

pub const fn zeroed() -> Self

Create a zeroed witness record (genesis / placeholder).

Trait Implementations§

Source§

impl Clone for WitnessRecord

Source§

fn clone(&self) -> WitnessRecord

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WitnessRecord

Source§

impl Debug for WitnessRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.