Skip to main content

KernelBinding

Struct KernelBinding 

Source
#[repr(C)]
pub struct KernelBinding { pub manifest_root_hash: [u8; 32], pub policy_hash: [u8; 32], pub binding_version: u16, pub min_runtime_version: u16, pub _pad0: u32, pub allowed_segment_mask: u64, pub _reserved: [u8; 48], }
Expand description

128-byte kernel binding record (padded for future evolution).

Layout:

OffsetSizeField
0x0032manifest_root_hash
0x2032policy_hash
0x402binding_version
0x422min_runtime_version
0x444_pad0 (alignment)
0x488allowed_segment_mask
0x5048_reserved

All multi-byte fields are little-endian on the wire.

Fields§

§manifest_root_hash: [u8; 32]

SHAKE-256-256 of the manifest root node.

§policy_hash: [u8; 32]

SHAKE-256-256 of the policy document.

§binding_version: u16

Binding format version (currently 1).

§min_runtime_version: u16

Minimum runtime version required (0 = any).

§_pad0: u32

Alignment padding (must be zero).

§allowed_segment_mask: u64

Bitmask of allowed segment types (0 = no restriction).

§_reserved: [u8; 48]

Reserved for future use (must be zero).

Implementations§

Source§

impl KernelBinding

Source

pub fn to_bytes(&self) -> [u8; 128]

Serialize the binding to a 128-byte array.

Source

pub fn from_bytes(data: &[u8; 128]) -> Self

Deserialize a KernelBinding from a 128-byte slice (unchecked).

Does NOT validate reserved fields. Use from_bytes_validated for security-critical paths that must reject non-zero padding/reserved.

Source

pub fn from_bytes_validated(data: &[u8; 128]) -> Result<Self, &'static str>

Deserialize and validate a KernelBinding from a 128-byte slice.

Rejects bindings where:

  • binding_version is 0 (uninitialized)
  • _pad0 is non-zero (spec violation)
  • _reserved contains non-zero bytes (spec violation / data smuggling)

Trait Implementations§

Source§

impl Clone for KernelBinding

Source§

fn clone(&self) -> KernelBinding

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for KernelBinding

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for KernelBinding

Source§

fn eq(&self, other: &KernelBinding) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for KernelBinding

Source§

impl Eq for KernelBinding

Source§

impl StructuralPartialEq for KernelBinding

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.